Skip to content

[WIP] Backward compatible and thread safe re-implementation of streamlog

FU Chengdong requested to merge github/fork/rete/thread-safe-mt into master

Created by: rete

BEGINRELEASENOTES

  • Transform prefix and base_prefix classes to simple std::function
  • Set default log level to MESSAGE
  • Modernized and simplified logscope class
{
  // create the scope object. Sets the logger config on creation
  logscope scope( streamlog::out, "MyTrackingProcessor", "DEBUG" ) ;
  // the scope object can be released before reaching the end of the scope
  scope.release();
  // the scope automatically releases here, settings back the old logger config
}
  • Introduced logconfig hidden class to handle the global logger configuration
  • Changed API for global logger initialization:
// example in main()
streamlog::logstream::global_init( &std::cout, "Marlin", "MESSAGE" ) ;
  • Use thread_local to make the global logger thread safe. The global_init() function initialize the config which is shared by all thread local global loggers.

ENDRELEASENOTES

Superseeds #15

Merge request reports

Loading