stdx::Log Class Reference
This log object allows a user to set a log level for all inserted objects, and then set a log level for the entire log. If the local log level is above the global log level then the output is not inserted, otherwise it is. This allows for choosing how much log information to output at runtime.
stdx::Log outputLog( std::cout, 2 ); outputLog.log(1) << "Log level is at or below 1!" << stdx::endl; outputLog.log(2) << "Log level is at or below 2!" << stdx::endl; outputLog.log(3) << "Log level is at or below 3!" << stdx::endl;
This code will output the following:
Log level is at or below 1! Log level is at or below 2!
Public Methods
Constructors and Destructors
- Log (std::ostream &os, int runtimeLogLevel=0)
Accessor Functions
- getRuntimeLogLevel ()
- isEnabled ()
Mutator Functions
- setRuntimeLogLevel (int logLevel)
- setEnabled (bool enabled)
- log (int logLevel=0)