C++ Actor Framework 0.19
|
Centrally logs events from all actors in an actor system. More...
#include <logger.hpp>
Classes | |
struct | event |
Encapsulates a single logging event. More... | |
class | line_builder |
Utility class for building user-defined log messages with CAF_ARG . More... | |
Public Member Functions | |
virtual void | log (event &&x)=0 |
Writes an entry to the event-queue of the logger. | |
virtual bool | accepts (unsigned level, std::string_view component_name)=0 |
Returns whether the logger is configured to accept input for given component and log level. | |
virtual void | ref_logger () const noexcept=0 |
Increases the reference count of the logger. | |
virtual void | deref_logger () const noexcept=0 |
Decreases the reference count of the logger and destroys the object if necessary. | |
virtual void | init (const actor_system_config &cfg)=0 |
Allows the logger to read its configuration from the actor system config. | |
virtual void | start ()=0 |
Starts any background threads needed by the logger. | |
virtual void | stop ()=0 |
Stops all background threads of the logger. | |
Static Public Member Functions | |
static actor_id | thread_local_aid () |
Returns the ID of the actor currently associated to the calling thread. | |
static actor_id | thread_local_aid (actor_id aid) |
Associates an actor ID to the calling thread and returns the last value. | |
static intrusive_ptr< logger > | make (actor_system &sys) |
Creates a new logger instance. | |
static void | render_fun_prefix (std::ostream &out, const event &x) |
Renders the prefix (namespace and class) of a fully qualified function. | |
static std::string_view | skip_path (std::string_view filename) |
Skips path in filename . | |
static void | set_current_actor_system (actor_system *) |
Stores the actor system for the current thread. | |
static logger * | current_logger () |
Returns the logger for the current thread or nullptr if none is registered. | |
Friends | |
void | intrusive_ptr_add_ref (const logger *ptr) noexcept |
void | intrusive_ptr_release (const logger *ptr) noexcept |
Centrally logs events from all actors in an actor system.
To enable logging in your application, you need to define CAF_LOG_LEVEL
. Per default, the logger generates log4j compatible output.
|
pure virtual |
Writes an entry to the event-queue of the logger.
@thread-safe