This class manages all logging activity. All other logging features will depend on this class.
More...
|
|
static void | applyDefaultConfiguration (const std::string &logFolder="") noexcept |
| | This method applies the default configuration of this framework.
|
| |
| static void | log (LogLevel logLevel, const std::string &classname, const std::string &method, const std::string &message, const std::vector< Note > ¬es, const std::optional< std::shared_ptr< Stacktrace >> &stacktrace=std::nullopt) noexcept |
| | The basic log method, that stores a log entry for the caller thread in the log-thread map. More...
|
| |
| static void | log (LogLevel logLevel, const Exception &exception) noexcept |
| | Converts the given exception into an LogEntry and stores that into the log. More...
|
| |
| static void | log (LogLevel logLevel, const std::exception &exception) noexcept |
| | Converts the given exception into an LogEntry and stores that into the log list. More...
|
| |
| static bool | check (bool condition, const std::string &method, const std::string &message, const std::vector< Note > ¬es, const std::optional< std::shared_ptr< Stacktrace >> &stacktrace=std::nullopt) noexcept |
| | Checks the given condition and logs a warning in case that the condition fails. More...
|
| |
| static const std::map< std::thread::id, std::list< LogEntry > > & | getLogThreadMap () noexcept |
| | Returns a reference to the log-thread map. Using it can be critical due to the multi-threaded-nature of this framework. More...
|
| |
| static void | reset () noexcept |
| | Resets the log-thread map and removes all previously stored log entries. More...
|
| |
| static size_t | getNumberOfLogEntries () noexcept |
| | Returns the number of log entries. More...
|
| |
| static void | registerCallback (LogLevel logLevel, std::function< void(const LogEntry &)> callback) noexcept |
| | Registers the given callback for the given LogLevel. More...
|
| |
| static const std::map< LogLevel, std::function< void(const LogEntry &)> > & | getCallbackMap () noexcept |
| | Returns a map containing the callback-LogLevel map. More...
|
| |
|
static void | removeCallbacks () noexcept |
| | Removes all registered callbacks.
|
| |
| static bool | writeToFile (const std::string &filename, OutputFormat format=EASY_EXCEPTION_OUTPUT_FORMAT) noexcept |
| | Writes all logs into a file with the given name. More...
|
| |
| static void | registerOutstream (LogLevel logLevel, std::ostream &outstream) noexcept |
| | Registers the given outstream with a specific log level. More...
|
| |
|
static void | removeOutstreams () noexcept |
| | Removes all registered out streams.
|
| |
| static const std::map< LogLevel, std::ostream * > & | getOutstreams () noexcept |
| | Returns the map of outstreams. More...
|
| |
| static void | registerLogRententionPolicy (std::shared_ptr< LogRetentionPolicy > policy) noexcept |
| | Registers a log retention policy. More...
|
| |
|
static void | removeLogRetentionPolicies () noexcept |
| | Removes all log retention policies.
|
| |
| static const std::map< uint8_t, std::shared_ptr< LogRetentionPolicy > > & | getLogRetentionPolicies () noexcept |
| | Returns the map of log retention policies. More...
|
| |
|
static void | releaseLogs () noexcept |
| | Releases all logs that are not retained by the retention policies.
|
| |
| static std::map< LogLevel, size_t > | countLogLevels () noexcept |
| | Counts all log levels and returns a map containing the different amounts. More...
|
| |
|
|
static std::recursive_mutex | Mutex |
| | The mutex that manages the log-thread map. It must be locked every time the LogThreadMap is queried or modified.
|
| |
|
static std::map< std::thread::id, std::list< LogEntry > > | LogThreadMap |
| | The log-thread map that contains a list of LogEntries for each thread.
|
| |
|
static std::map< LogLevel, std::function< void(const LogEntry &)> > | CallbackMap |
| | This map can hold a single callback for each LogLevel.
|
| |
| static std::atomic_uint16_t | SuspendLoggingCounter |
| | This boolean variable can be set to true to suspend logging for a short time period. More...
|
| |
|
static std::map< LogLevel, std::ostream * > | OutStreamMap |
| | This map contains the output streams that should be used for the specific LogLevels.
|
| |
|
static std::map< uint8_t, std::shared_ptr< LogRetentionPolicy > > | LogRetentionPolicies |
| | This map holds the log retention policies.
|
| |
This class manages all logging activity. All other logging features will depend on this class.