AnCH Framework 0.1
Another C++ Hack Framework
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)
virtual ~MessageFormatter ()
const std::string formatMessage (const std::string &category, const anch::log::Level &level, const std::string &message) const

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{C++ time standard}: The date
  • D{C++ time standard}: The high precision date
  • t: The current thread ID
  • f: The function name (not imlpemented)
Author
Vincent Lachenal

Constructor & Destructor Documentation

◆ MessageFormatter() [1/2]

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

MessageFormatter default constructor

◆ MessageFormatter() [2/2]

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

MessageFormatter constructor

Parameters
linePatternThe message line pattern

◆ ~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

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