version 1.21, 2005/10/31 16:53:08
|
version 1.29, 2006/11/10 18:14:58
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) |
|
// |
|
// Modified By: Dave Rosckes (rosckes@us.ibm.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_Logger_h | #ifndef Pegasus_Logger_h |
|
|
#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) \ | #define PEG_LOGGER_TRACE(ARGS_LIST) \ |
do \ | do \ |
{ \ | { \ |
|
|
} \ | } \ |
} \ | } \ |
while (0) | while (0) |
|
#endif |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
{ | { |
TRACE_LOG, | TRACE_LOG, |
STANDARD_LOG, | STANDARD_LOG, |
|
AUDIT_LOG, // Use only if PEGASUS_DISABLE_AUDIT_LOGGER is not defined |
ERROR_LOG, | ERROR_LOG, |
DEBUG_LOG | DEBUG_LOG |
}; | }; |
| |
enum { NUM_LOGS = 4 }; |
enum { NUM_LOGS = 5 }; |
| |
/** 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 |
|
|
@param Arg0 - Arg 9 - Up to 9 arguments representing the variables | @param Arg0 - Arg 9 - Up to 9 arguments representing the variables |
that go into the log entry. | that go into the log entry. |
<pre> | <pre> |
Logger::put(Logger::TRACE_LOG, "CIMServer", Logger::WARNING, |
Logger::put(Logger::TRACE_LOG, System::CIMSERVER, Logger::WARNING, |
"X=$0, Y=$1, Z=$2", 88, "Hello World", 7.5); | "X=$0, Y=$1, Z=$2", 88, "Hello World", 7.5); |
</pre> | </pre> |
*/ | */ |
|
|
const Formatter::Arg& arg1, | const Formatter::Arg& arg1, |
const Formatter::Arg& arg2); | const Formatter::Arg& arg2); |
| |
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
|
|
/** put_l - Puts a localized message to the defined log file | /** put_l - Puts a localized message to the defined log file |
@param logFileType - Type of log file (Trace, etc.) | @param logFileType - Type of log file (Trace, etc.) |
@param systemId - ID of the system generating the log entry within | @param systemId - ID of the system generating the log entry within |
|
|
@param Arg0 - Arg 9 - Up to 9 arguments representing the variables | @param Arg0 - Arg 9 - Up to 9 arguments representing the variables |
that go into the log entry. | that go into the log entry. |
<pre> | <pre> |
Logger::put(Logger::TRACE_LOG, "CIMServer", Logger::WARNING, |
Logger::put(Logger::TRACE_LOG, System::CIMSERVER, Logger::WARNING, |
"X=$0, Y=$1, Z=$2", 88, "Hello World", 7.5); | "X=$0, Y=$1, Z=$2", 88, "Hello World", 7.5); |
</pre> | </pre> |
*/ | */ |
|
|
const Formatter::Arg& arg1, | const Formatter::Arg& arg1, |
const Formatter::Arg& arg2); | const Formatter::Arg& arg2); |
| |
#endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */ |
|
|
|
/** Puts a message to the define log. Should only be used for trace type | /** Puts a message to the define log. Should only be used for trace type |
logs. | logs. |
*/ | */ |
|
|
const Formatter::Arg& arg1, | const Formatter::Arg& arg1, |
const Formatter::Arg& arg2); | const Formatter::Arg& arg2); |
| |
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
|
|
/** Puts a localized message to the log. Should only be used | /** Puts a localized message to the log. Should only be used |
for trace type logs. | for trace type logs. |
*/ | */ |
|
|
const Formatter::Arg& arg1, | const Formatter::Arg& arg1, |
const Formatter::Arg& arg2); | const Formatter::Arg& arg2); |
| |
#endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */ |
|
|
|
/** setHomeDirectory | /** setHomeDirectory |
*/ | */ |
static void setHomeDirectory(const String& homeDirectory); | static void setHomeDirectory(const String& homeDirectory); |
|
|
} | } |
</pre> | </pre> |
*/ | */ |
static bool wouldLog(Uint32 logLevel) |
static Boolean wouldLog(Uint32 logLevel) |
{ | { |
return _severityMask & logLevel; |
return (_severityMask & logLevel) != 0; |
} | } |
| |
private: | private: |