📄 logger.cpp
字号:
const String& systemId, Uint32 logLevel, const String& formatString, const Formatter::Arg& arg0, const Formatter::Arg& arg1, const Formatter::Arg& arg2){ if (wouldLog(logLevel)) { Logger::_putInternal(logFileType, systemId, 0, logLevel, formatString, String::EMPTY, arg0, arg1, arg2); }}void Logger::put_l( LogFileType logFileType, const String& systemId, Uint32 logLevel, 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, const Formatter::Arg& arg5, const Formatter::Arg& arg6, const Formatter::Arg& arg7, const Formatter::Arg& arg8, const Formatter::Arg& arg9){ if (wouldLog(logLevel)) { Logger::_putInternal(logFileType, systemId, 0, logLevel, formatString, messageId, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); }}void Logger::put_l( LogFileType logFileType, const String& systemId, Uint32 logLevel, const String& messageId, const String& formatString){ if (wouldLog(logLevel)) { Logger::_putInternal(logFileType, systemId, 0, logLevel, formatString, messageId); }}void Logger::put_l( LogFileType logFileType, const String& systemId, Uint32 logLevel, const String& messageId, const String& formatString, const Formatter::Arg& arg0){ if (wouldLog(logLevel)) { Logger::_putInternal(logFileType, systemId, 0, logLevel, formatString, messageId, arg0); }}void Logger::put_l( LogFileType logFileType, const String& systemId, Uint32 logLevel, const String& messageId, const String& formatString, const Formatter::Arg& arg0, const Formatter::Arg& arg1){ if (wouldLog(logLevel)) { Logger::_putInternal(logFileType, systemId, 0, logLevel, formatString, messageId, arg0, arg1); }}void Logger::put_l( LogFileType logFileType, const String& systemId, Uint32 logLevel, const String& messageId, const String& formatString, const Formatter::Arg& arg0, const Formatter::Arg& arg1, const Formatter::Arg& arg2){ if (wouldLog(logLevel)) { Logger::_putInternal(logFileType, systemId, 0, logLevel, formatString, messageId, arg0, arg1, arg2); }}void Logger::trace( LogFileType logFileType, const String& systemId, const Uint32 logComponent, const String& formatString, const Formatter::Arg& arg0, const Formatter::Arg& arg1, const Formatter::Arg& arg2, const Formatter::Arg& arg3, const Formatter::Arg& arg4, const Formatter::Arg& arg5, const Formatter::Arg& arg6, const Formatter::Arg& arg7, const Formatter::Arg& arg8, const Formatter::Arg& arg9){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, String::EMPTY, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); }}void Logger::trace( LogFileType logFileType, const String& systemId, const Uint32 logComponent, const String& formatString){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, String::EMPTY); }}void Logger::trace( LogFileType logFileType, const String& systemId, const Uint32 logComponent, const String& formatString, const Formatter::Arg& arg0){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, String::EMPTY, arg0); }}void Logger::trace( LogFileType logFileType, const String& systemId, const Uint32 logComponent, const String& formatString, const Formatter::Arg& arg0, const Formatter::Arg& arg1){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, String::EMPTY, arg0, arg1); }}void Logger::trace( LogFileType logFileType, const String& systemId, const Uint32 logComponent, const String& formatString, const Formatter::Arg& arg0, const Formatter::Arg& arg1, const Formatter::Arg& arg2){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, String::EMPTY, arg0, arg1, arg2); }}void Logger::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, const Formatter::Arg& arg5, const Formatter::Arg& arg6, const Formatter::Arg& arg7, const Formatter::Arg& arg8, const Formatter::Arg& arg9){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, messageId, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); }}void Logger::trace_l( LogFileType logFileType, const String& systemId, const Uint32 logComponent, const String& messageId, const String& formatString){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, messageId); }}void Logger::trace_l( LogFileType logFileType, const String& systemId, const Uint32 logComponent, const String& messageId, const String& formatString, const Formatter::Arg& arg0){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, messageId, arg0); }}void Logger::trace_l( LogFileType logFileType, const String& systemId, const Uint32 logComponent, const String& messageId, const String& formatString, const Formatter::Arg& arg0, const Formatter::Arg& arg1){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, messageId, arg0, arg1); }}void Logger::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){ if (wouldLog(Logger::TRACE)) { Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE, formatString, messageId, arg0, arg1, arg2); }}void Logger::setHomeDirectory(const String& homeDirectory){ _homeDirectory = homeDirectory;}void Logger::setlogLevelMask( const String logLevelList ){ Uint32 position = 0; Uint32 logLevelType = 0; String logLevelName = logLevelList; // Check if logLevel has been specified if (logLevelName != String::EMPTY) { // initialise _severityMask _severityMask = 0; // Set logLevelType to indicate the level of logging // required by the user. if (String::equalNoCase(logLevelName,"TRACE")) { logLevelType = Logger::TRACE; } else if (String::equalNoCase(logLevelName,"INFORMATION")) { logLevelType = Logger::INFORMATION; } else if (String::equalNoCase(logLevelName,"WARNING")) { logLevelType = Logger::WARNING; } else if (String::equalNoCase(logLevelName,"SEVERE")) { logLevelType = Logger::SEVERE; } else if (String::equalNoCase(logLevelName,"FATAL")) { logLevelType = Logger::FATAL; } // Setting _severityMask. NOTE: When adding new logLevels // it is essential that they are adding in ascending order // based on priority. Once a case statement is true we will // continue to set all following log levels with a higher // priority. switch(logLevelType) { case Logger::TRACE: _severityMask |= Logger::TRACE; case Logger::INFORMATION: _severityMask |= Logger::INFORMATION; case Logger::WARNING: _severityMask |= Logger::WARNING; case Logger::SEVERE: _severityMask |= Logger::SEVERE; case Logger::FATAL: _severityMask |= Logger::FATAL; } } else { // Property logLevel not specified, set default value. _severityMask = ~Logger::TRACE; } return ;}Boolean Logger::isValidlogLevel(const String logLevel){ // Validate the logLevel and modify the logLevel argument // to reflect the invalid logLevel Uint32 position=0; Uint32 index=0; String logLevelName = String::EMPTY; Boolean validlogLevel=false; Boolean retCode=true; logLevelName = logLevel; if (logLevelName != String::EMPTY) { // Lookup the index for logLevel name in _logLevel_LIST index = 0; validlogLevel = false; while (index < _NUM_LOGLEVEL) { if (String::equalNoCase(logLevelName, LOGLEVEL_LIST[index])) { // Found logLevel, break from the loop validlogLevel = true; break; } else { index++; } } } else { // logLevels is empty, it is a valid value so return true return _SUCCESS; } return validlogLevel;}PEGASUS_NAMESPACE_END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -