4 #ifndef ILANG_UTIL_LOG_H__
5 #define ILANG_UTIL_LOG_H__
10 #include <glog/logging.h>
17 #define ILA_DLOG(tag) DLOG_IF(INFO, DebugLog::Find(tag)) << "[" << tag << "] "
20 #define ILA_INFO DLOG(INFO)
21 #define ILA_WARN DLOG(WARNING)
23 #define ILA_ERROR DLOG(ERROR)
25 #define ILA_INFO_IF(b) DLOG_IF(INFO, b)
27 #define ILA_WARN_IF(b) DLOG_IF(WARNING, b)
29 #define ILA_ERROR_IF(b) DLOG_IF(ERROR, b)
33 #define ILA_ASSERT(b) DLOG_IF(FATAL, !(b))
39 #define ILA_CHECK(b) CHECK(b)
40 #define ILA_CHECK_EQ(a, b) CHECK_EQ(a, b)
42 #define ILA_CHECK_NE(a, b) CHECK_NE(a, b)
44 #define ILA_CHECK_STREQ(a, b) CHECK_STREQ(a, b)
46 #define ILA_NOT_NULL(ptr) CHECK_NOTNULL(ptr)
80 static void Enable(
const std::string& tag);
83 static void Disable(
const std::string& tag);
89 static bool Find(
const std::string& tag);
93 static std::set<std::string> debug_tags_;
102 #endif // ILANG_UTIL_LOG_H__
void SetToStdErr(const int &to_err)
Pipe log to stderr. Log messages to stderr instead of logfiles, if set to 1.
static void Disable(const std::string &tag)
Remove a debug tag.
A one-time class for initializing GLog.
Definition: log.h:70
static bool Find(const std::string &tag)
Find if the tag is enabled.
The wrapper for enabling and disabling debug tags.
Definition: log.h:77
static void Clear()
Clear all tags.
LogInitter()
Constructor to initialize GLog.
void SetLogPath(const std::string &path)
Set the path for log file. If specified, logfiles are written into this directory instead of the defa...
void SetLogLevel(const int &lvl)
Set the minimun log level. Log messages at or above this level will be logged. (Default: 0) ...
static void Enable(const std::string &tag)
Add a debug tag.