CppLogging  1.0.4.0
C++ Logging Library
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
CppLogging::Record Class Reference

Logging record. More...

#include <record.h>

Public Member Functions

 Record ()
 
 Record (const Record &)=default
 
 Record (Record &&)=default
 
 ~Record ()=default
 
Recordoperator= (const Record &)=default
 
Recordoperator= (Record &&)=default
 
bool IsFormatStored () const noexcept
 Is the record contains stored format message and its arguments. More...
 
template<typename... T>
RecordFormat (fmt::format_string< T... > pattern, T &&... args)
 Format message and its arguments. More...
 
template<typename... T>
RecordStoreFormat (fmt::format_string< T... > pattern, T &&... args)
 Store format message and its arguments. More...
 
template<typename Arg >
RecordStoreCustom (const Arg &arg)
 Store custom format message and its arguments. More...
 
template<typename... Args>
RecordStoreCustomFormat (std::string_view pattern, Args &&... args)
 
size_t StoreListBegin ()
 Store list format message. More...
 
template<typename... Args>
RecordStoreList (Args &&... args)
 
template<typename... Args>
RecordStoreListFormat (std::string_view pattern, Args &&... args)
 
RecordStoreListEnd (size_t begin)
 
std::string RestoreFormat () const
 Restore format message and its arguments. More...
 
void Clear ()
 Clear logging record. More...
 
void swap (Record &record) noexcept
 Swap two instances. More...
 

Static Public Member Functions

static std::string RestoreFormat (std::string_view pattern, const std::vector< uint8_t > &buffer, size_t offset, size_t size)
 Restore format of the custom data type. More...
 

Public Attributes

uint64_t timestamp
 Timestamp of the logging record. More...
 
uint64_t thread
 Thread Id of the logging record. More...
 
Level level
 Level of the logging record. More...
 
std::string logger
 Logger name of the logging record. More...
 
std::string message
 Message of the logging record. More...
 
std::vector< uint8_t > buffer
 Buffer of the logging record. More...
 
std::vector< uint8_t > raw
 Record content after layout. More...
 

Friends

void swap (Record &record1, Record &record2) noexcept
 

Detailed Description

Logging record.

Logging record encapsulates all required fields in a single instance:

Logging records are created inside Logger class and processed by logging appenders, filters and layouts.

Not thread-safe.

Examples
format.cpp.

Definition at line 36 of file record.h.

Constructor & Destructor Documentation

◆ Record() [1/3]

CppLogging::Record::Record ( )
inline

Definition at line 11 of file record.inl.

◆ Record() [2/3]

CppLogging::Record::Record ( const Record )
default

◆ Record() [3/3]

CppLogging::Record::Record ( Record &&  )
default

◆ ~Record()

CppLogging::Record::~Record ( )
default

Member Function Documentation

◆ Clear()

void CppLogging::Record::Clear ( )
inline

Clear logging record.

Definition at line 449 of file record.inl.

◆ Format()

template<typename... T>
Record & CppLogging::Record::Format ( fmt::format_string< T... >  pattern,
T &&...  args 
)
inline

Format message and its arguments.

Definition at line 361 of file record.inl.

◆ IsFormatStored()

bool CppLogging::Record::IsFormatStored ( ) const
inlinenoexcept

Is the record contains stored format message and its arguments.

Definition at line 64 of file record.h.

◆ operator=() [1/2]

Record& CppLogging::Record::operator= ( const Record )
default

◆ operator=() [2/2]

Record& CppLogging::Record::operator= ( Record &&  )
default

◆ RestoreFormat() [1/2]

std::string CppLogging::Record::RestoreFormat ( ) const
inline

Restore format message and its arguments.

Definition at line 89 of file record.h.

◆ RestoreFormat() [2/2]

std::string CppLogging::Record::RestoreFormat ( std::string_view  pattern,
const std::vector< uint8_t > &  buffer,
size_t  offset,
size_t  size 
)
static

Restore format of the custom data type.

Definition at line 270 of file record.cpp.

◆ StoreCustom()

template<typename Arg >
Record & CppLogging::Record::StoreCustom ( const Arg &  arg)
inline

Store custom format message and its arguments.

Definition at line 377 of file record.inl.

◆ StoreCustomFormat()

template<typename... Args>
Record & CppLogging::Record::StoreCustomFormat ( std::string_view  pattern,
Args &&...  args 
)
inline
Examples
format.cpp.

Definition at line 386 of file record.inl.

◆ StoreFormat()

template<typename... T>
Record & CppLogging::Record::StoreFormat ( fmt::format_string< T... >  pattern,
T &&...  args 
)
inline

Store format message and its arguments.

Definition at line 368 of file record.inl.

◆ StoreList()

template<typename... Args>
Record & CppLogging::Record::StoreList ( Args &&...  args)
inline
Examples
format.cpp.

Definition at line 427 of file record.inl.

◆ StoreListBegin()

size_t CppLogging::Record::StoreListBegin ( )
inline

Store list format message.

Examples
format.cpp.

Definition at line 415 of file record.inl.

◆ StoreListEnd()

Record & CppLogging::Record::StoreListEnd ( size_t  begin)
inline
Examples
format.cpp.

Definition at line 441 of file record.inl.

◆ StoreListFormat()

template<typename... Args>
Record & CppLogging::Record::StoreListFormat ( std::string_view  pattern,
Args &&...  args 
)
inline

Definition at line 436 of file record.inl.

◆ swap()

void CppLogging::Record::swap ( Record record)
inlinenoexcept

Swap two instances.

Definition at line 460 of file record.inl.

Friends And Related Function Documentation

◆ swap

void swap ( Record record1,
Record record2 
)
friend

Definition at line 472 of file record.inl.

Member Data Documentation

◆ buffer

std::vector<uint8_t> CppLogging::Record::buffer

Buffer of the logging record.

Definition at line 50 of file record.h.

◆ level

Level CppLogging::Record::level

Level of the logging record.

Definition at line 44 of file record.h.

◆ logger

std::string CppLogging::Record::logger

Logger name of the logging record.

Definition at line 46 of file record.h.

◆ message

std::string CppLogging::Record::message

Message of the logging record.

Definition at line 48 of file record.h.

◆ raw

std::vector<uint8_t> CppLogging::Record::raw

Record content after layout.

Definition at line 53 of file record.h.

◆ thread

uint64_t CppLogging::Record::thread

Thread Id of the logging record.

Definition at line 42 of file record.h.

◆ timestamp

uint64_t CppLogging::Record::timestamp

Timestamp of the logging record.

Definition at line 40 of file record.h.


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