AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::log::fmt::MessageFormatter Class Reference

#include <messageFormatter.hpp>

Collaboration diagram for anch::log::fmt::MessageFormatter:

Public Member Functions

 MessageFormatter ()
 MessageFormatter (const std::string &linePattern)
 MessageFormatter (const MessageFormatter &)=delete
virtual ~MessageFormatter ()
MessageFormatter & operator= (const MessageFormatter &)=delete
const std::string formatMessage (const std::string &category, const anch::log::Level &level, const std::string &message) const

Friends

class anch::log::Writer

Detailed Description

Format a message for logging acording writer configuration

Paterns are:

  • $c: The category (logger name)
  • $p: The logging level
  • $m: The message
  • $d{strftime format}: The date
  • $D{anch::date format}: The high precision date
  • $C{key}: The value of key in the map diagnostic context
  • $t: The current thread ID

Other characters (including a $ which does not start a pattern) are written as is.

Author
Vincent Lachenal

Constructor & Destructor Documentation

◆ MessageFormatter() [1/3]

anch::log::fmt::MessageFormatter::MessageFormatter ( )

MessageFormatter default constructor

◆ MessageFormatter() [2/3]

anch::log::fmt::MessageFormatter::MessageFormatter ( const std::string & linePattern)

MessageFormatter constructor

Parameters
linePatternThe message line pattern

◆ MessageFormatter() [3/3]

anch::log::fmt::MessageFormatter::MessageFormatter ( const MessageFormatter & )
delete

Prohibits MessageFormatter copy constructor (it owns its formatters)

Here is the call graph for this function:

◆ ~MessageFormatter()

virtual anch::log::fmt::MessageFormatter::~MessageFormatter ( )
virtual

MessageFormatter destructor

Member Function Documentation

◆ formatMessage()

const std::string anch::log::fmt::MessageFormatter::formatMessage ( const std::string & category,
const anch::log::Level & level,
const std::string & message ) const

Format message.

Parameters
categoryThe logger category
levelThe logging level
messageThe logging message
Returns
The formatted message

◆ operator=()

MessageFormatter & anch::log::fmt::MessageFormatter::operator= ( const MessageFormatter & )
delete

Prohibits MessageFormatter copy assignment (it owns its formatters)

Here is the call graph for this function:

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