Responsible for processing log messages. More...
#include <mitsuba/mitsuba.h>
Public Member Functions | |
Logger (ELogLevel logLevel=EDebug) | |
Construct a new logger with the given minimum log level. More... | |
void | log (ELogLevel level, const Class *theClass, const char *fileName, int lineNumber, const char *fmt,...) |
Process a log message. More... | |
void | logProgress (Float progress, const std::string &name, const std::string &formatted, const std::string &eta, const void *ptr) |
Process a progress message. More... | |
void | setLogLevel (ELogLevel level) |
Set the log level (everything below will be ignored) More... | |
void | setErrorLevel (ELogLevel level) |
Set the error log level (this level and anything above will throw exceptions). More... | |
ELogLevel | getLogLevel () const |
Return the current log level. More... | |
ELogLevel | getErrorLevel () const |
Return the current error level. More... | |
void | addAppender (Appender *appender) |
Add an appender to this logger. More... | |
void | removeAppender (Appender *appender) |
Remove an appender from this logger. More... | |
void | clearAppenders () |
Remove all appenders from this logger. More... | |
size_t | getAppenderCount () const |
Return the number of registered appenders. More... | |
Appender * | getAppender (size_t index) |
Return one of the appenders. More... | |
const Appender * | getAppender (size_t index) const |
Return one of the appenders. More... | |
void | setFormatter (Formatter *formatter) |
Set the logger's formatter implementation. More... | |
Formatter * | getFormatter () |
Return the logger's formatter implementation. More... | |
bool | readLog (std::string &target) |
Return the contents of the log file as a string (if it exists) More... | |
size_t | getWarningCount () const |
Return the number of warnings reported so far. More... | |
virtual const Class * | getClass () const |
Retrieve this object's class. More... | |
Public Member Functions inherited from Object | |
Object () | |
Construct a new object. More... | |
int | getRefCount () const |
Return the current reference count. More... | |
void | incRef () const |
Increase the reference count of the object by one. More... | |
void | decRef (bool autoDeallocate=true) const |
Decrease the reference count of the object and possibly deallocate it. More... | |
virtual std::string | toString () const |
Return a human-readable string representation of the object's contents. More... | |
Static Public Member Functions | |
static void | staticInitialization () |
Initialize logging. More... | |
static void | staticShutdown () |
Shutdown logging. More... | |
Static Public Member Functions inherited from Object | |
static void | staticInitialization () |
Initializes the built-in reference count debugger (if enabled) More... | |
static void | staticShutdown () |
Free the memory taken by staticInitialization() More... | |
Static Public Attributes | |
static Class * | m_theClass |
Static Public Attributes inherited from Object | |
static Class * | m_theClass |
Pointer to the object's class descriptor. More... | |
Protected Member Functions | |
virtual | ~Logger () |
Virtual destructor. More... | |
Protected Member Functions inherited from Object | |
virtual | ~Object () |
Virtual private deconstructor. (Will only be called by ref) More... | |
Friends | |
class | Statistics |
Responsible for processing log messages.
Upon receiving a log message, the Logger class invokes a Formatter to convert it into a human-readable form. Following that, it sends this information to every registered Appender.
Construct a new logger with the given minimum log level.
|
protectedvirtual |
Virtual destructor.
void mitsuba::Logger::addAppender | ( | Appender * | appender | ) |
Add an appender to this logger.
void mitsuba::Logger::clearAppenders | ( | ) |
Remove all appenders from this logger.
|
inline |
Return one of the appenders.
|
inline |
Return one of the appenders.
|
inline |
Return the number of registered appenders.
|
virtual |
Retrieve this object's class.
Reimplemented from Object.
|
inline |
Return the current error level.
|
inline |
Return the logger's formatter implementation.
|
inline |
Return the current log level.
|
inline |
Return the number of warnings reported so far.
void mitsuba::Logger::log | ( | ELogLevel | level, |
const Class * | theClass, | ||
const char * | fileName, | ||
int | lineNumber, | ||
const char * | fmt, | ||
... | |||
) |
Process a log message.
level | Log level of the message |
theClass | Class descriptor of the message creator |
fileName | Source file of the message creator |
lineNumber | Source line number of the message creator |
fmt | printf-style string formatter |
void mitsuba::Logger::logProgress | ( | Float | progress, |
const std::string & | name, | ||
const std::string & | formatted, | ||
const std::string & | eta, | ||
const void * | ptr | ||
) |
Process a progress message.
progress | Percentage value in [0,100] |
name | Title of the progress message |
formatted | Formatted string representation of the message |
eta | Estimated time until 100% is reached. |
ptr | Custom pointer payload. This is used to express the context of a progress message. When rendering a scene, it will usually contain a pointer to the associated RenderJob . |
ptr
argument is missing in the Python bindings bool mitsuba::Logger::readLog | ( | std::string & | target | ) |
Return the contents of the log file as a string (if it exists)
true
upon success void mitsuba::Logger::removeAppender | ( | Appender * | appender | ) |
Remove an appender from this logger.
void mitsuba::Logger::setErrorLevel | ( | ELogLevel | level | ) |
Set the error log level (this level and anything above will throw exceptions).
The value provided here can be used for instance to turn warnings into errors. But level must always be less than EError, i.e. it isn't possible to cause errors not to throw an exception.
void mitsuba::Logger::setFormatter | ( | Formatter * | formatter | ) |
Set the logger's formatter implementation.
void mitsuba::Logger::setLogLevel | ( | ELogLevel | level | ) |
Set the log level (everything below will be ignored)
|
static |
Initialize logging.
|
static |
Shutdown logging.
|
friend |
|
static |