Sirikata
|
Classes | |
class | LogLevelParser |
class | LogLevelMapParser |
Typedefs | |
typedef std::tr1::unordered_map< const char *, String > | CapsNameMap |
typedef boost::shared_mutex | SharedMutex |
typedef boost::upgrade_lock < SharedMutex > | UpgradeLock |
typedef boost::upgrade_to_unique_lock < SharedMutex > | UpgradedLock |
Enumerations | |
enum | LOGGING_LEVEL { fatal = 1, error = 8, warning = 64, warn = warning, info = 512, debug = 4096, detailed = 8192, insane = 32768 } |
Functions | |
SIRIKATA_FUNCTION_EXPORT const String & | LogModuleString (const char *base) |
SIRIKATA_FUNCTION_EXPORT const char * | LogLevelString (LOGGING_LEVEL lvl, const char *lvl_as_string) |
SIRIKATA_FUNCTION_EXPORT void | setOutputFP (FILE *fp) |
Set the output file pointer for *all* output, not just SILOG output. | |
SIRIKATA_FUNCTION_EXPORT void | setLogStream (std::ostream *logfs) |
Set the output stream for SILOG output, e.g. | |
SIRIKATA_FUNCTION_EXPORT void | finishLog () |
Allow logging to finish, e.g. | |
Variables | |
SIRIKATA_EXPORT std::ostream * | SirikataLogStream = &std::cerr |
SharedMutex | LogModuleStringsMutex |
InitializeGlobalOptions | o ("", Sirikata_Logging_OptionValue_defaultLevel=new OptionValue("loglevel","debug","Sets the default level for logging when no per-module override", LogLevelParser()), Sirikata_Logging_OptionValue_atLeastLevel=new OptionValue("maxloglevel","insane","Sets the maximum logging level any module may be set to", LogLevelParser()), Sirikata_Logging_OptionValue_moduleLevel=new OptionValue("moduleloglevel","","Sets a per-module logging level: should be formatted <module>=debug,<othermodule>=info...", LogLevelMapParser()), NULL) |
std::tr1::unordered_map < std::string, LOGGING_LEVEL > | module_level |
typedef std::tr1::unordered_map<const char*, String> Sirikata::Logging::CapsNameMap |
typedef boost::shared_mutex Sirikata::Logging::SharedMutex |
typedef boost::upgrade_to_unique_lock<SharedMutex> Sirikata::Logging::UpgradedLock |
typedef boost::upgrade_lock<SharedMutex> Sirikata::Logging::UpgradeLock |
void Sirikata::Logging::finishLog | ( | ) |
Allow logging to finish, e.g.
flush output and cleanup output streams. May block.
References SirikataLogStream.
Referenced by main().
const char * Sirikata::Logging::LogLevelString | ( | LOGGING_LEVEL | lvl, |
const char * | lvl_as_string | ||
) |
const String & Sirikata::Logging::LogModuleString | ( | const char * | base | ) |
References LOGGING_MAX_MODULE_LENGTH, and LogModuleStringsMutex.
void Sirikata::Logging::setLogStream | ( | std::ostream * | logfs | ) |
Set the output stream for SILOG output, e.g.
to redirect output to a file or in memory.
References SirikataLogStream.
Referenced by Sirikata::DaemonizeAndSetOutputs().
void Sirikata::Logging::setOutputFP | ( | FILE * | fp | ) |
Set the output file pointer for *all* output, not just SILOG output.
This includes both stdout and stderr.
References fileno_platform.
Referenced by Sirikata::DaemonizeAndSetOutputs().
Referenced by LogModuleString().
std::tr1::unordered_map<std::string,LOGGING_LEVEL> Sirikata::Logging::module_level |
InitializeGlobalOptions Sirikata::Logging::o("", Sirikata_Logging_OptionValue_defaultLevel=new OptionValue("loglevel","debug","Sets the default level for logging when no per-module override",LogLevelParser()), Sirikata_Logging_OptionValue_atLeastLevel=new OptionValue("maxloglevel","insane","Sets the maximum logging level any module may be set to",LogLevelParser()), Sirikata_Logging_OptionValue_moduleLevel=new OptionValue("moduleloglevel","","Sets a per-module logging level: should be formatted <module>=debug,<othermodule>=info...",LogLevelMapParser()), NULL) |
std::ostream * Sirikata::Logging::SirikataLogStream = &std::cerr |
Referenced by Sirikata::DaemonizeAndSetOutputs(), finishLog(), and setLogStream().