C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::log::event Class Reference

Captures a single event for a logger. More...

#include <event.hpp>

Inheritance diagram for caf::log::event:
caf::ref_counted caf::detail::atomic_ref_counted

Classes

struct  field
 A single, user-defined field. More...
 
struct  field_list
 A list of user-defined fields. More...
 

Public Types

using field_node = detail::mbr_list_node<field>
 
- Public Types inherited from caf::ref_counted
using super = detail::atomic_ref_counted
 

Public Member Functions

 event (unsigned level, std::string_view component, const detail::source_location &loc, caf::actor_id aid) noexcept
 
 event (const event &)=delete
 
eventoperator= (const event &)=delete
 
event_ptr with_message (std::string_view msg, keep_timestamp_t) const
 Returns a deep copy of this with a new message without changing the timestamp.
 
event_ptr with_message (std::string_view msg) const
 Returns a copy of this with a new message and an updated timestamp.
 
unsigned level () const noexcept
 Returns the severity level of the event.
 
std::string_view component () const noexcept
 Returns the name of the component that generated the event.
 
uint_least32_t line_number () const noexcept
 Returns the line number at which the event was generated.
 
const char * file_name () const noexcept
 Returns the name of the file in which the event was generated.
 
const char * function_name () const noexcept
 Returns the name of the function in which the event was generated.
 
chunked_string message () const noexcept
 Returns the user-defined message of the event.
 
field_list fields () const noexcept
 Returns the user-defined fields of the event.
 
caf::actor_id actor_id () const noexcept
 Returns the ID of the actor that generated the event.
 
caf::timestamp timestamp () const noexcept
 Returns the timestamp of the event.
 
std::thread::id thread_id () const noexcept
 Returns the ID of the thread that generated the event.
 
- Public Member Functions inherited from caf::detail::atomic_ref_counted
 atomic_ref_counted (const atomic_ref_counted &)
 
atomic_ref_countedoperator= (const atomic_ref_counted &)
 
void ref () const noexcept
 Increases reference count by one.
 
void deref () const noexcept
 Decreases reference count by one and calls request_deletion when it drops to zero.
 
bool unique () const noexcept
 Queries whether there is exactly one reference.
 
size_t get_reference_count () const noexcept
 Queries the current reference count for this object.
 

Static Public Member Functions

template<class Arg , class... Args>
static event_ptr make (unsigned level, std::string_view component, const detail::source_location &loc, caf::actor_id aid, std::string_view fmt, Arg &&arg, Args &&... args)
 
static event_ptr make (unsigned level, std::string_view component, const detail::source_location &loc, caf::actor_id aid, std::string_view msg)
 

Friends

class event_sender
 

Additional Inherited Members

- Protected Attributes inherited from caf::detail::atomic_ref_counted
std::atomic< size_t > rc_
 

Detailed Description

Captures a single event for a logger.


The documentation for this class was generated from the following files: