|
#define | COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) |
|
#define | COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) |
|
#define | COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) |
|
#define | COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) |
|
#define | COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) |
|
#define | COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage) |
|
#define | COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage) |
|
#define | COMPACT_GOOGLE_LOG_ERROR COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage) |
|
#define | COMPACT_GOOGLE_LOG_FATAL COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage) |
|
#define | COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage) |
|
#define | ERROR 0 |
|
#define | COMPACT_GOOGLE_LOG_EX_0(ClassName, ...) COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ##__VA_ARGS__) |
|
#define | COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR |
|
#define | LOG_IS_ON(severity) ((::cef::logging::LOG_##severity) >= ::cef::logging::GetMinLogLevel()) |
|
#define | VLOG_IS_ON(verboselevel) ((verboselevel) <= ::cef::logging::GetVlogLevel(__FILE__)) |
|
#define | LAZY_STREAM(stream, condition) !(condition) ? (void)0 : ::cef::logging::LogMessageVoidify() & (stream) |
|
#define | LOG_STREAM(severity) COMPACT_GOOGLE_LOG_##severity.stream() |
|
#define | LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity)) |
|
#define | LOG_IF(severity, condition) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) |
|
#define | SYSLOG(severity) LOG(severity) |
|
#define | SYSLOG_IF(severity, condition) LOG_IF(severity, condition) |
|
#define | VLOG_STREAM(verbose_level) cef::logging::LogMessage(__FILE__, __LINE__, -verbose_level).stream() |
|
#define | VLOG(verbose_level) LAZY_STREAM(VLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level)) |
|
#define | VLOG_IF(verbose_level, condition) |
|
#define | VPLOG_STREAM(verbose_level) |
|
#define | VPLOG(verbose_level) LAZY_STREAM(VPLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level)) |
|
#define | VPLOG_IF(verbose_level, condition) |
|
#define | LOG_ASSERT(condition) LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". " |
|
#define | SYSLOG_ASSERT(condition) SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". " |
|
#define | PLOG_STREAM(severity) |
|
#define | PLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity)) |
|
#define | PLOG_IF(severity, condition) LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) |
|
#define | EAT_STREAM_PARAMETERS true ? (void)0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL) |
|
#define | CHECK(condition) |
|
#define | PCHECK(condition) |
|
#define | CHECK_OP(name, op, val1, val2) |
|
#define | DEFINE_CHECK_OP_IMPL(name, op) |
|
#define | CHECK_EQ(val1, val2) CHECK_OP(EQ, ==, val1, val2) |
|
#define | CHECK_NE(val1, val2) CHECK_OP(NE, !=, val1, val2) |
|
#define | CHECK_LE(val1, val2) CHECK_OP(LE, <=, val1, val2) |
|
#define | CHECK_LT(val1, val2) CHECK_OP(LT, <, val1, val2) |
|
#define | CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2) |
|
#define | CHECK_GT(val1, val2) CHECK_OP(GT, >, val1, val2) |
|
#define | ENABLE_DLOG 1 |
|
#define | DCHECK_IS_ON() 1 |
|
#define | DLOG_IS_ON(severity) LOG_IS_ON(severity) |
|
#define | DLOG_IF(severity, condition) LOG_IF(severity, condition) |
|
#define | DLOG_ASSERT(condition) LOG_ASSERT(condition) |
|
#define | DPLOG_IF(severity, condition) PLOG_IF(severity, condition) |
|
#define | DVLOG_IF(verboselevel, condition) VLOG_IF(verboselevel, condition) |
|
#define | DVPLOG_IF(verboselevel, condition) VPLOG_IF(verboselevel, condition) |
|
#define | DLOG(severity) LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity)) |
|
#define | DPLOG(severity) LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity)) |
|
#define | DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) |
|
#define | DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) |
|
#define | COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ##__VA_ARGS__) |
|
#define | COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL |
|
#define | DCHECK(condition) |
|
#define | DPCHECK(condition) |
|
#define | DCHECK_OP(name, op, val1, val2) |
|
#define | DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2) |
|
#define | DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2) |
|
#define | DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2) |
|
#define | DCHECK_LT(val1, val2) DCHECK_OP(LT, <, val1, val2) |
|
#define | DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) |
|
#define | DCHECK_GT(val1, val2) DCHECK_OP(GT, >, val1, val2) |
|
#define | NOTREACHED() DCHECK(false) |
|
#define | assert(x) DLOG_ASSERT(x) |
|
#define | NOTIMPLEMENTED_POLICY 4 |
|
#define | NOTIMPLEMENTED_MSG "NOT IMPLEMENTED" |
|
#define | NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG |
|
A bunch of macros for logging.
NOTE: The contents of this file are only available to applications that link against the libcef_dll_wrapper target.
WARNING: Logging macros should not be used in the main/browser process before calling CefInitialize or in sub-processes before calling CefExecuteProcess.
INSTRUCTIONS:
The way to log things is to stream things to LOG(). E.g.,
LOG(INFO) << "Found " << num_cookies << " cookies";
You can also do conditional logging:
LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
The CHECK(condition) macro is active in both debug and release builds and effectively performs a LOG(FATAL) which terminates the process and generates a crashdump unless a debugger is attached.
There are also "debug mode" logging macros like the ones above:
DLOG(INFO) << "Found cookies";
DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
All "debug mode" logging is compiled away to nothing for non-debug mode compiles. LOG_IF and development flags also work well together because the code can be compiled away sometimes.
We also have
LOG_ASSERT(assertion);
DLOG_ASSERT(assertion);
which is syntactic sugar for "{,D}LOG_IF(FATAL, assert fails) << assertion;"
There are "verbose level" logging macros. They look like
VLOG(1) << "I'm printed when you run the program with --v=1 or more";
VLOG(2) << "I'm printed when you run the program with --v=2 or more";
These always log at the INFO log level (when they log at all). The verbose logging can also be turned on module-by-module. For instance,
--vmodule=profile=2,icon_loader=1,browser_*=3,*/chromeos/*=4 --v=0
will cause:
- VLOG(2) and lower messages to be printed from profile.{h,cc}
- VLOG(1) and lower messages to be printed from icon_loader.{h,cc}
- VLOG(3) and lower messages to be printed from files prefixed with "browser"
- VLOG(4) and lower messages to be printed from files under a "chromeos" directory.
- VLOG(0) and lower messages to be printed from elsewhere
The wildcarding functionality shown by (c) supports both '*' (match 0 or more characters) and '?' (match any single character) wildcards. Any pattern containing a forward or backward slash will be tested against the whole pathname and not just the module. E.g., "*‍/foo/bar/*=2" would change the logging level for all code in source files under a "foo/bar" directory.
There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as
if (VLOG_IS_ON(2)) {
// do some logging preparation and logging
// that can't be accomplished with just VLOG(2) << ...;
}
There is also a VLOG_IF "verbose level" condition macro for sample cases, when some extra computation and preparation for logs is not needed.
VLOG_IF(1, (size > 1024))
<< "I'm printed when size is more than 1024 and when you run the "
"program with --v=1 or more";
We also override the standard 'assert' to use 'DLOG_ASSERT'.
Lastly, there is:
PLOG(ERROR) << "Couldn't do foo";
DPLOG(ERROR) << "Couldn't do foo";
PLOG_IF(ERROR, cond) << "Couldn't do foo";
DPLOG_IF(ERROR, cond) << "Couldn't do foo";
PCHECK(condition) << "Couldn't do foo";
DPCHECK(condition) << "Couldn't do foo";
which append the last system error to the message in string form (taken from GetLastError() on Windows and errno on POSIX).
The supported severity levels for macros that allow you to specify one are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL.
Very important: logging a message at the FATAL severity level causes the program to terminate (after the message is logged).
There is the special severity of DFATAL, which logs FATAL in debug mode, ERROR in normal mode.