ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
Classes | Namespaces | Macros | Functions
log.h File Reference
#include <set>
#include <string>
#include <glog/logging.h>

Go to the source code of this file.

Classes

class  ilang::LogInitter
 A one-time class for initializing GLog. More...
 
class  ilang::DebugLog
 The wrapper for enabling and disabling debug tags. More...
 

Namespaces

 ilang
 

Macros

#define ILA_DLOG(tag)   DLOG_IF(INFO, DebugLog::Find(tag)) << "[" << tag << "] "
 Log debug message to INFO if the "tag" has been enabled.
 
#define ILA_INFO   DLOG(INFO)
 Log the message to INFO (lvl 0). (Debug)
 
#define ILA_WARN   DLOG(WARNING)
 Log the message to WARNING (lvl 1). (Debug)
 
#define ILA_ERROR   DLOG(ERROR)
 Log the message to ERROR (lvl 2). (Debug)
 
#define ILA_INFO_IF(b)   DLOG_IF(INFO, b)
 Conditionally log the message to INFO (lvl 0). (Debug)
 
#define ILA_WARN_IF(b)   DLOG_IF(WARNING, b)
 Conditionally log the message to WARNING (lvl 1). (Debug)
 
#define ILA_ERROR_IF(b)   DLOG_IF(ERROR, b)
 Conditionally log the message to ERROR (lvl 2). (Debug)
 
#define ILA_ASSERT(b)   DLOG_IF(FATAL, !(b))
 Assertion with message logged to FATAL (lvl 3). (Debug)
 
#define ILA_CHECK(b)   CHECK(b)
 Assertion with message logged to FATAL (lvl 3). (Debug/Release)
 
#define ILA_CHECK_EQ(a, b)   CHECK_EQ(a, b)
 Assert equal with message logged to FATAL (lvl 3). (Debug/Release)
 
#define ILA_CHECK_NE(a, b)   CHECK_NE(a, b)
 Assert not equal with message logged to FATAL (lvl 3). (Debug/Release)
 
#define ILA_CHECK_STREQ(a, b)   CHECK_STREQ(a, b)
 Assert string equal with message logged to FATAL (lvl 3). (Debug/Release)
 
#define ILA_NOT_NULL(ptr)   CHECK_NOTNULL(ptr)
 Assert point not NULL – FATAL (lvl 3). (Debug/Release)
 

Functions

void ilang::SetLogLevel (const int &lvl)
 Set the minimun log level. Log messages at or above this level will be logged. (Default: 0) More...
 
void ilang::SetLogPath (const std::string &path)
 Set the path for log file. If specified, logfiles are written into this directory instead of the default logging directory (/tmp).
 
void ilang::SetToStdErr (const int &to_err)
 Pipe log to stderr. Log messages to stderr instead of logfiles, if set to 1.
 

Detailed Description

The header file for the debug/logging/asserting system.