roadrunner
2.6.0
Fast simulator for SBML models
|
The roadrunner logger. More...
#include <rrLogger.h>
Public Types | |
enum | Level { LOG_CURRENT = 0 , LOG_FATAL = 1 , LOG_CRITICAL = 2 , LOG_ERROR = 3 , LOG_WARNING = 4 , LOG_NOTICE = 5 , LOG_INFORMATION = 6 , LOG_DEBUG = 7 , LOG_TRACE =8 } |
same as Poco level, repeat here to avoid including any Poco files as Poco is usually linked statically so third parties would not need to have Poco installed. More... | |
Static Public Member Functions | |
static void | setLevel (int level=LOG_CURRENT) |
sets the logging level to one a value from Logger::Level | |
static int | getLevel () |
get the current logging level. | |
static void | disableLogging () |
Suppresses all logging output. | |
static void | disableConsoleLogging () |
stops logging to the console, but file logging may continue. | |
static void | enableConsoleLogging (int level=LOG_CURRENT) |
turns on console logging at the given level. | |
static void | enableFileLogging (const std::string &fileName="", int level=LOG_CURRENT) |
turns on file logging to the given file as the given level. More... | |
static void | disableFileLogging () |
turns off file logging, but has no effect on console logging. | |
static std::string | getCurrentLevelAsString () |
get the textural form of the current logging level. | |
static std::string | getFileName () |
get the name of the currently used log file. | |
static void | setFormattingPattern (const std::string &format) |
Internally, RoadRunner uses the Poco logging framework, so we can custom format logging output based on a formatting pattern std::string. More... | |
static std::string | getFormattingPattern () |
get the currently set formatting pattern. | |
static std::string | levelToString (int level) |
gets the textual form of a logging level Enum for a given value. | |
static Level | stringToLevel (const std::string &str) |
parses a std::string and returns a Logger::Level | |
static bool | getColoredOutput () |
check if we have colored logging enabled. | |
static void | setColoredOutput (bool) |
enable / disable colored output | |
static void | setProperty (const std::string &name, const std::string &value) |
Set the color of the output logging messages. More... | |
static void | log (Level level, const std::string &msg) |
logs a message to the log. More... | |
static void | setConsoleStream (std::ostream *os) |
Set a pointer to an std::ostream object where the console logger should log to. More... | |
The roadrunner logger.
A set of static method for setting the logging level.
enum rr::Logger::Level |
same as Poco level, repeat here to avoid including any Poco files as Poco is usually linked statically so third parties would not need to have Poco installed.
|
static |
turns on file logging to the given file as the given level.
If fileName is an empty std::string, then this will use the file specified in the Config::LOGGER_LOG_FILE_PATH. If this is empty, a file called "roadrunner.log" will be created in the temp directory.
The temp directory may be specified via Config::TEMP_DIR_PATH. If this is empty, then the system spefified temp dir is used.
|
static |
logs a message to the log.
This is most useful from Python as C++ code will typically call the LoggingBuffer via the Log macro.
|
static |
Set a pointer to an std::ostream object where the console logger should log to.
Normally, this points to std::clog.
This is here so that the Logger can properly re-direct to the Python sys.stderr object as the QT IPython console only reads output from the python sys.stdout and sys.stderr file objects and not the C++ file streams.
|
static |
Internally, RoadRunner uses the Poco logging framework, so we can custom format logging output based on a formatting pattern std::string.
The format pattern is used as a template to format the message and is copied character by character except for the following special characters, which are replaced by the corresponding value.
An example pattern of "%Y-%m-%d %H:%M:%S %p: %t"
would produce the following output:
2013-10-25 14:12:45 Fatal: console and file: A fatal error 2013-10-25 14:12:45 Critical: console and file: A critical error 2013-10-25 14:12:45 Error: console and file: An error 2013-10-25 14:12:45 Warning: console and file: A warning. 2013-10-25 14:12:45 Notice: console and file: A notice.
The following formatting pattern descriptions is copied from the Poco documentation:
|
static |
Set the color of the output logging messages.
In the future, we may add additional properties her.
The following properties are supported: enableColors: Enable or disable colors. traceColor: Specify color for trace messages. debugColor: Specify color for debug messages. informationColor: Specify color for information messages. noticeColor: Specify color for notice messages. warningColor: Specify color for warning messages. errorColor: Specify color for error messages. criticalColor: Specify color for critical messages. fatalColor: Specify color for fatal messages.
The following color values are supported:
default black red green brown blue magenta cyan gray darkgray lightRed lightGreen yellow lightBlue lightMagenta lightCyan white