~marcoil/glcompbench/glproxy-flavor

« back to all changes in this revision

Viewing changes to src/log.cc

  • Committer: Marc Ordinas i Llopis
  • Date: 2012-02-17 11:53:03 UTC
  • mfrom: (67.1.9 trunk)
  • Revision ID: marc.ordinasillopis@linaro.org-20120217115303-x1rjlcmfihx5vgg1
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2011 Linaro Limited
3
 
 *
4
 
 * This file is part of glcompbench.
5
 
 *
6
 
 * glcompbench is free software: you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation, either version 3 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * glcompbench is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with glcompbench.  If not, see <http://www.gnu.org/licenses/>.
18
 
 *
19
 
 * Authors:
20
 
 *  Alexandros Frantzis <alexandros.frantzis@linaro.org>
21
 
 *  Jesse Barker <jesse.barker@linaro.org>
22
 
 */
23
 
 
24
 
#include <cstdio>
25
 
#include <cstdarg>
26
 
 
27
 
#include "options.h"
28
 
#include "log.h"
29
 
 
30
 
void
31
 
Log::info(const char *fmt, ...)
32
 
{
33
 
    va_list ap;
34
 
    va_start(ap, fmt);
35
 
    vfprintf(stdout, fmt, ap);
36
 
    va_end(ap);
37
 
}
38
 
 
39
 
void
40
 
Log::debug(const char *fmt, ...)
41
 
{
42
 
    if (!Options::show_debug)
43
 
        return;
44
 
    va_list ap;
45
 
    va_start(ap, fmt);
46
 
    vfprintf(stdout, fmt, ap);
47
 
    va_end(ap);
48
 
}
49
 
 
50
 
void
51
 
Log::error(const char *fmt, ...)
52
 
{
53
 
    va_list ap;
54
 
    va_start(ap, fmt);
55
 
    vfprintf(stderr, fmt, ap);
56
 
    va_end(ap);
57
 
}
58