version 1.31, 2007/10/17 20:37:27
|
version 1.35, 2008/08/12 18:26:27
|
|
|
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/MessageLoader.h> | #include <Pegasus/Common/MessageLoader.h> |
| |
// The Logger::trace optimization introduces the PEG_LOGGER_TRACE macro which |
|
// propagates branch conditions wherever it is used. The optimization is |
|
// disabled for C-Cover builds so the coverage of these branches is not |
|
// measured. |
|
#ifdef PEGASUS_CCOVER |
|
# define PEG_LOGGER_TRACE(ARGS_LIST) \ |
|
Logger::trace ARGS_LIST |
|
#else |
|
# define PEG_LOGGER_TRACE(ARGS_LIST) \ |
|
do \ |
|
{ \ |
|
if (Logger::wouldLog(Logger::TRACE)) \ |
|
{ \ |
|
Logger::trace ARGS_LIST ; \ |
|
} \ |
|
} \ |
|
while (0) |
|
#endif |
|
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class LoggerRep; | class LoggerRep; |
|
|
TRACE_LOG, | TRACE_LOG, |
STANDARD_LOG, | STANDARD_LOG, |
AUDIT_LOG, // Use only if PEGASUS_ENABLE_AUDIT_LOGGER is defined | AUDIT_LOG, // Use only if PEGASUS_ENABLE_AUDIT_LOGGER is defined |
ERROR_LOG, |
ERROR_LOG |
DEBUG_LOG |
|
}; | }; |
| |
enum { NUM_LOGS = 5 }; |
enum { NUM_LOGS = 4 }; |
| |
/** Log file Level - Defines the loglevel of the log entry irrespective of | /** Log file Level - Defines the loglevel of the log entry irrespective of |
which log file it goes into. This is actually a bit mask as defined in | which log file it goes into. This is actually a bit mask as defined in |
|
|
LogFileType logFileType, | LogFileType logFileType, |
const String& systemId, | const String& systemId, |
Uint32 logLevel, | Uint32 logLevel, |
const String& messageId, |
const char* messageId, |
const String& formatString, |
const char* formatString, |
const Formatter::Arg& arg0, | const Formatter::Arg& arg0, |
const Formatter::Arg& arg1, | const Formatter::Arg& arg1, |
const Formatter::Arg& arg2, | const Formatter::Arg& arg2, |
|
|
LogFileType logFileType, | LogFileType logFileType, |
const String& systemId, | const String& systemId, |
Uint32 logLevel, | Uint32 logLevel, |
const String& messageId, |
const char* messageId, |
const String& formatString); |
const char* formatString); |
| |
/** Optimized one-argument form of put_l(). | /** Optimized one-argument form of put_l(). |
*/ | */ |
|
|
LogFileType logFileType, | LogFileType logFileType, |
const String& systemId, | const String& systemId, |
Uint32 logLevel, | Uint32 logLevel, |
const String& messageId, |
const char* messageId, |
const String& formatString, |
const char* formatString, |
const Formatter::Arg& arg0); | const Formatter::Arg& arg0); |
| |
/** Optimized two-argument form of put_l(). | /** Optimized two-argument form of put_l(). |
|
|
LogFileType logFileType, | LogFileType logFileType, |
const String& systemId, | const String& systemId, |
Uint32 logLevel, | Uint32 logLevel, |
const String& messageId, |
const char* messageId, |
const String& formatString, |
const char* formatString, |
const Formatter::Arg& arg0, | const Formatter::Arg& arg0, |
const Formatter::Arg& arg1); | const Formatter::Arg& arg1); |
| |
|
|
LogFileType logFileType, | LogFileType logFileType, |
const String& systemId, | const String& systemId, |
Uint32 logLevel, | Uint32 logLevel, |
const String& messageId, |
const char* messageId, |
const String& formatString, |
const char* formatString, |
const Formatter::Arg& arg0, | const Formatter::Arg& arg0, |
const Formatter::Arg& arg1, | const Formatter::Arg& arg1, |
const Formatter::Arg& arg2); | const Formatter::Arg& arg2); |
| |
/** Puts a message to the define log. Should only be used for trace type |
/** Puts a trace message into the specified log. |
logs. |
|
*/ | */ |
static void trace( | static void trace( |
LogFileType logFileType, | LogFileType logFileType, |
const String& systemId, | const String& systemId, |
const Uint32 logComponent, | const Uint32 logComponent, |
const String& formatString, |
const String& message); |
const Formatter::Arg& arg0, |
|
const Formatter::Arg& arg1, |
|
const Formatter::Arg& arg2, |
|
const Formatter::Arg& arg3, |
|
const Formatter::Arg& arg4 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg5 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg6 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg7 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg8 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg9 = Formatter::DEFAULT_ARG); |
|
|
|
/** Optimized three-argument form of trace(). |
|
*/ |
|
static void trace( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& formatString); |
|
|
|
/** Optimized one-argument form of trace(). |
|
*/ |
|
static void trace( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& formatString, |
|
const Formatter::Arg& arg0); |
|
|
|
/** Optimized two-argument form of trace(). |
|
*/ |
|
static void trace( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& formatString, |
|
const Formatter::Arg& arg0, |
|
const Formatter::Arg& arg1); |
|
|
|
/** Optimized three-argument form of trace(). |
|
*/ |
|
static void trace( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& formatString, |
|
const Formatter::Arg& arg0, |
|
const Formatter::Arg& arg1, |
|
const Formatter::Arg& arg2); |
|
|
|
/** Puts a localized message to the log. Should only be used |
|
for trace type logs. |
|
*/ |
|
static void trace_l( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& messageId, |
|
const String& formatString, |
|
const Formatter::Arg& arg0, |
|
const Formatter::Arg& arg1, |
|
const Formatter::Arg& arg2, |
|
const Formatter::Arg& arg3, |
|
const Formatter::Arg& arg4 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg5 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg6 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg7 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg8 = Formatter::DEFAULT_ARG, |
|
const Formatter::Arg& arg9 = Formatter::DEFAULT_ARG); |
|
|
|
/** Optimized zero-argument form of trace_l(). |
|
*/ |
|
static void trace_l( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& messageId, |
|
const String& formatString); |
|
|
|
/** Optimized one-argument form of trace_l(). |
|
*/ |
|
static void trace_l( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& messageId, |
|
const String& formatString, |
|
const Formatter::Arg& arg0); |
|
|
|
/** Optimized two-argument form of trace_l(). |
|
*/ |
|
static void trace_l( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& messageId, |
|
const String& formatString, |
|
const Formatter::Arg& arg0, |
|
const Formatter::Arg& arg1); |
|
|
|
/** Optimized three-argument form of trace_l(). |
|
*/ |
|
static void trace_l( |
|
LogFileType logFileType, |
|
const String& systemId, |
|
const Uint32 logComponent, |
|
const String& messageId, |
|
const String& formatString, |
|
const Formatter::Arg& arg0, |
|
const Formatter::Arg& arg1, |
|
const Formatter::Arg& arg2); |
|
| |
/** setHomeDirectory | /** setHomeDirectory |
*/ | */ |
|
|
const Uint32 logComponent, | const Uint32 logComponent, |
Uint32 logLevel, | Uint32 logLevel, |
const String& formatString, | const String& formatString, |
const String& messageId, |
const char* messageId, |
const Formatter::Arg& arg0 = Formatter::DEFAULT_ARG, | const Formatter::Arg& arg0 = Formatter::DEFAULT_ARG, |
const Formatter::Arg& arg1 = Formatter::DEFAULT_ARG, | const Formatter::Arg& arg1 = Formatter::DEFAULT_ARG, |
const Formatter::Arg& arg2 = Formatter::DEFAULT_ARG, | const Formatter::Arg& arg2 = Formatter::DEFAULT_ARG, |