~linaro-graphics-wg/libmatrix/misc-changes-glmark2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Copyright (c) 2010-2012 Linaro Limited
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the MIT License which accompanies
// this distribution, and is available at
// http://www.opensource.org/licenses/mit-license.php
//
// Contributors:
//     Alexandros Frantzis <alexandros.frantzis@linaro.org>
//     Jesse Barker <jesse.barker@linaro.org>
//
#ifndef LOG_H_
#define LOG_H_

#include <string>

class Log
{
public:
    static void init(const std::string& appname, bool do_debug = false)
    {
        appname_ = appname;
        do_debug_ = do_debug;
    }
    // Emit an informational message
    static void info(const char *fmt, ...);
    // Emit a debugging message
    static void debug(const char *fmt, ...);
    // Emit an error message
    static void error(const char *fmt, ...);
    // Explicit flush of the log buffer
    static void flush();
    // A prefix constant that informs the logging infrastructure that the log
    // message is a continuation of a previous log message to be put on the
    // same line.
    static const std::string continuation_prefix;
private:
    // A constant for identifying the log messages as originating from a
    // particular application.
    static std::string appname_;
    // Indicates whether debug level messages should generate any output
    static bool do_debug_;
};

#endif /* LOG_H_ */