C API Documentation
|
#include <rrLogger.h>
Public Types | |
enum | Level { LOG_CURRENT = 0 , LOG_FATAL = 1 , LOG_CRITICAL , LOG_ERROR , LOG_WARNING , LOG_NOTICE , LOG_INFORMATION , LOG_DEBUG , LOG_TRACE } |
Static Public Member Functions | |
static void | setLevel (int level=LOG_CURRENT) |
static int | getLevel () |
static void | disableLogging () |
static void | disableConsoleLogging () |
static void | enableConsoleLogging (int level=LOG_CURRENT) |
static void | enableFileLogging (const std::string &fileName="", int level=LOG_CURRENT) |
static void | disableFileLogging () |
static std::string | getCurrentLevelAsString () |
static std::string | getFileName () |
static void | setFormattingPattern (const std::string &format) |
static std::string | getFormattingPattern () |
static std::string | levelToString (int level) |
static Level | stringToLevel (const std::string &str) |
static bool | getColoredOutput () |
static void | setColoredOutput (bool) |
static void | setProperty (const std::string &name, const std::string &value) |
static void | log (Level level, const std::string &msg) |
static void | setConsoleStream (std::ostream *os) |
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 |
stops logging to the console, but file logging may continue.
|
static |
turns off file logging, but has no effect on console logging.
|
static |
Suppresses all logging output
|
static |
turns on console logging at the given level.
|
static |
turns on file logging to the given file as the given level.
If fileName is an empty 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 |
check if we have colored logging enabled.
|
static |
get the textural form of the current logging level.
|
static |
get the name of the currently used log file.
|
static |
get the currently set formatting pattern.
|
static |
get the current logging level.
|
static |
gets the textual form of a logging level Enum for a given value.
|
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 |
enable / disable colored output
|
static |
Set a pointer to an 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 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 |
sets the logging level to one a value from Logger::Level
|
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
|
static |
parses a string and returns a Logger::Level