Logger. More...

#include <logger.h>

Public Member Functions

 LM_DISABLE_CONSTRUCT (Logger)
 

Detailed Description

Logger.

This class is responsible for the log output of the framework. The output message is designed to be natural and human-readable. The user can query log messages with the simple set of macros.

Before any log messages, the user implementation need to start the logger with Run function. Internally the thread dedicated to the log output is created and executes the event loop waiting for the log messages.

Features:

  • Multi-threaded support
    • The log message can be issued from any other threads, which is useful for output messages within the render loop.
  • Progressive display support
    • The renderer often need to display run-time information such as the progress of the rendering or ETA. For this, we implemented a simple message rewriting mechanism which can work orthogonally with any other log outputs.
  • Indentation support
    • Indentation is helpful for readability of the log messages, e.g., the messages from the calling function can be indented.
  • Controllable verbose level

Example:

  1. Log an information message
    ...
    LM_LOG_INFO("Hello, world.");
    ...
    
  2. Log a message with indentation
    ...
    {
        LM_LOG_INFO("Begin some process");
        LM_LOG_INDENTER();
        ...
    }
    ...