Actions
Logging Guidelines¶
Log Levels¶
NONE: no messages
ERROR: used to notify the user of an unexpected or failed event during process execution
WARN: used to notify the user of events that may affect the process or to notify the developer of unusual variable values
INFO: used to notify the user of major process events
DEBUG: used to notify the developer of important variable values and minor process events
TRACE: used to notify the developer of method calls and less important variable values
ALL: all messages
Example¶
bool isFoo(int arg)
{
_LOG_TRACE("isFoo(" << arg << ")");
if (arg < 0) {
_LOG_ERROR("arg is less than 0! arg must be greater than 0!");
return false;
}
else if (arg < 10) {
_LOG_WARN("It is unusual for arg to be less than 10");
}
g_value += arg;
_LOG_DEBUG("g_value == " << g_value);
_LOG_INFO("The return of this method is true and is important.");
return true;
}
Updated by Vince Lehman about 10 years ago · 1 revisions