Use ASSERTS in main.
[Tsunagari.git] / src / log.h
blobc79528183facb181197df7e235ef1de1ed3404e7
1 /*********************************
2 ** Tsunagari Tile Engine **
3 ** log.h **
4 ** Copyright 2011-2012 OmegaSDG **
5 *********************************/
7 #ifndef LOG_H
8 #define LOG_H
10 #include <boost/utility.hpp> // for boost::noncopyable
11 #include <string>
13 enum verbosity_t {
14 V_QUIET = 1, //! Display fatals.
15 V_NORMAL, //! Display fatals and errors.
16 V_VERBOSE //! Display fatals, errors and info.
19 class Log : boost::noncopyable
21 public:
22 /**
23 * Initialize the clock for log timestamps.
25 static bool init();
27 /**
28 * Set the logging verbosity. Some log messages may be suppressed depending
29 * on this setting.
31 static void setVerbosity(verbosity_t mode);
33 /**
34 * Log an info message to the console if verbosity is "V_VERBOSE".
36 static void info(std::string domain, std::string msg);
38 /**
39 * Log an error message to the console if verbosity is "V_VERBOSE" or
40 * "V_NORMAL".
42 static void err(std::string domain, std::string msg);
44 /**
45 * Log a fatal error message to the console.
47 static void fatal(std::string domain, std::string msg);
49 /**
50 * Used by main() to report the verbosity setting on engine startup.
52 static void reportVerbosityOnStartup();
54 private:
55 Log();
58 /**
59 * Exports Log hooks to the python interpreter.
61 void exportLog();
63 #endif