version 1.47, 2006/11/08 20:38:30
|
version 1.48, 2006/11/10 18:14:58
|
|
|
#include <cstring> | #include <cstring> |
#include "Logger.h" | #include "Logger.h" |
#include "System.h" | #include "System.h" |
#include <Pegasus/Common/MessageLoader.h> //l10n |
#include <Pegasus/Common/MessageLoader.h> |
| |
#if defined(PEGASUS_USE_SYSLOGS) | #if defined(PEGASUS_USE_SYSLOGS) |
# include <syslog.h> | # include <syslog.h> |
|
|
| |
// KS: I put the second test in just in case some trys to create | // KS: I put the second test in just in case some trys to create |
// a completly erronous directory. At least we will get a message | // a completly erronous directory. At least we will get a message |
if (!System::isDirectory(lgDir)){ |
if (!System::isDirectory(lgDir)) |
//l10n |
{ |
//cerr << "Logging Disabled"; |
|
MessageLoaderParms parms("Common.Logger.LOGGING_DISABLED", | MessageLoaderParms parms("Common.Logger.LOGGING_DISABLED", |
"Logging Disabled"); | "Logging Disabled"); |
| |
|
|
#else | #else |
| |
#ifdef PEGASUS_OS_ZOS | #ifdef PEGASUS_OS_ZOS |
logIdendity = System::CIMSERVER.getCString(); |
logIdentity = System::CIMSERVER.getCString(); |
// If System Log is used open it | // If System Log is used open it |
System::openlog(logIdendity, LOG_PID, LOG_DAEMON); |
System::openlog(logIdentity, LOG_PID, LOG_DAEMON); |
#endif | #endif |
| |
#endif | #endif |
|
|
private: | private: |
| |
#ifdef PEGASUS_OS_ZOS | #ifdef PEGASUS_OS_ZOS |
CString logIdendity; |
CString logIdentity; |
#endif | #endif |
ofstream _logs[int(Logger::NUM_LOGS)]; | ofstream _logs[int(Logger::NUM_LOGS)]; |
}; | }; |
|
|
void Logger::_putInternal( | void Logger::_putInternal( |
LogFileType logFileType, | LogFileType logFileType, |
const String& systemId, | const String& systemId, |
const Uint32 logComponent, // TODO: Support logComponent mask in future release |
const Uint32 logComponent, // FUTURE: Support logComponent mask |
Uint32 logLevel, | Uint32 logLevel, |
const String& formatString, | const String& formatString, |
const String& messageId, // l10n |
const String& messageId, |
const Formatter::Arg& arg0, | const Formatter::Arg& arg0, |
const Formatter::Arg& arg1, | const Formatter::Arg& arg1, |
const Formatter::Arg& arg2, | const Formatter::Arg& arg2, |