CppLogging  1.0.4.0
C++ Logging Library
Public Member Functions | List of all members
CppLogging::TextLayout Class Reference

Text layout. More...

#include <text_layout.h>

Inheritance diagram for CppLogging::TextLayout:
CppLogging::Layout CppLogging::Element

Public Member Functions

 TextLayout (const std::string &pattern="{UtcDateTime} [{Thread}] {Level} {Logger} - {Message}{EndLine}")
 Initialize text logging layout with a given pattern. More...
 
 TextLayout (const TextLayout &)=delete
 
 TextLayout (TextLayout &&layout)=delete
 
virtual ~TextLayout ()
 
TextLayoutoperator= (const TextLayout &)=delete
 
TextLayoutoperator= (TextLayout &&layout)=delete
 
const std::string & pattern () const noexcept
 Get the text layout pattern. More...
 
void LayoutRecord (Record &record) override
 Layout the given logging record into a raw buffer. More...
 
- Public Member Functions inherited from CppLogging::Element
virtual bool IsStarted () const noexcept
 Is the logging element started? More...
 
virtual bool Start ()
 Start the logging element. More...
 
virtual bool Stop ()
 Stop the logging element. More...
 

Detailed Description

Text layout.

Text layout converts the given logging record into the text string using a given pattern. Text layout pattern is a string with a special placeholders provided inside curly brackets ("{}").

Supported placeholders:

Thread-safe.

Definition at line 47 of file text_layout.h.

Constructor & Destructor Documentation

◆ TextLayout() [1/3]

CppLogging::TextLayout::TextLayout ( const std::string &  pattern = "{UtcDateTime} [{Thread}] {Level} {Logger} - {Message}{EndLine}")
explicit

Initialize text logging layout with a given pattern.

Parameters
pattern- Layout pattern

Definition at line 804 of file text_layout.cpp.

◆ TextLayout() [2/3]

CppLogging::TextLayout::TextLayout ( const TextLayout )
delete

◆ TextLayout() [3/3]

CppLogging::TextLayout::TextLayout ( TextLayout &&  layout)
delete

◆ ~TextLayout()

CppLogging::TextLayout::~TextLayout ( )
virtual

Definition at line 815 of file text_layout.cpp.

Member Function Documentation

◆ LayoutRecord()

void CppLogging::TextLayout::LayoutRecord ( Record record)
overridevirtual

Layout the given logging record into a raw buffer.

This method will update the raw filed of the given logging record.

Parameters
record- Logging record

Implements CppLogging::Layout.

Definition at line 823 of file text_layout.cpp.

◆ operator=() [1/2]

TextLayout& CppLogging::TextLayout::operator= ( const TextLayout )
delete

◆ operator=() [2/2]

TextLayout& CppLogging::TextLayout::operator= ( TextLayout &&  layout)
delete

◆ pattern()

const std::string & CppLogging::TextLayout::pattern ( ) const
noexcept

Get the text layout pattern.

Definition at line 821 of file text_layout.cpp.


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