|
mCRL2
|
Class for logging messages. More...
#include <logger.h>
Public Member Functions | |
| logger (const log_level_t l) | |
| Default constructor. | |
| ~logger () | |
| Destructor; flushes output. Flushing during destruction is important to confer thread safety to the logging mechanism. Requires that output performs output in an atomic way. | |
| std::ostringstream & | get () |
| Get access to the stream provided by the logger. | |
Static Public Member Functions | |
| static void | register_output_policy (output_policy &policy) |
| Register output policy. | |
| static void | unregister_output_policy (output_policy &policy) |
| Unregister output policy. | |
| static void | clear_output_policies () |
| Clear all output policies. | |
| static void | set_reporting_level (const log_level_t level) |
| Set reporting level. | |
| static std::optional< log_level_t > & | thread_reporting_level () |
| The reporting level override of the current thread. When it has a value, it takes precedence over the global reporting level for mCRL2log statements on this thread; see scoped_reporting_level. | |
| static log_level_t | get_reporting_level () |
| Get reporting level, i.e. the level that is in effect on the current thread: the override of the current thread when one is active, and the global level otherwise. | |
| static void | set_report_time_info () |
| Indicate that timing information should be printed. | |
| static void | clear_report_time_info () |
| Indicate that timing information should not be printed. | |
| static bool | get_report_time_info () |
| Get whether timing information is printed. | |
Static Protected Member Functions | |
| static std::atomic< log_level_t > & | log_level () |
| static std::atomic< bool > & | m_print_time_information () |
| An indication whether time information should be printed. | |
| static std::set< output_policy * > & | output_policies () |
| Output policies. | |
Protected Attributes | |
| std::ostringstream | m_os |
| Stream that is printed to internally Collects the full debug message that we are currently printing. | |
| log_level_t | m_level |
| The loglevel of the current message. | |
| time_t | m_timestamp = 0L |
| Timestamp of the current message. | |
Additional Inherited Members | |
Private Member Functions inherited from mcrl2::utilities::noncopyable | |
| noncopyable ()=default | |
| ~noncopyable ()=default | |
| noncopyable (noncopyable &&)=default | |
| noncopyable & | operator= (noncopyable &&)=default |
| noncopyable (const noncopyable &)=delete | |
| noncopyable & | operator= (const noncopyable &)=delete |
Class for logging messages.
Based on a description in the article "Logging In C++", Petru Marginean Dr. Dobb's Journal, September 5, 2007 (url: http://drdobbs.com/cpp/201804215) Requires that OutputPolicy is a class which as a static member output(const std::string&)
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
The reporting level override of the current thread. When it has a value, it takes precedence over the global reporting level for mCRL2log statements on this thread; see scoped_reporting_level.
|
inlinestatic |
|
protected |
|
protected |
|
protected |