HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::LogFormatter Class Reference

Reformats log messages with extra logging details. More...

#include <rwsf/core/LogFormatter.h>

Inheritance diagram for rwsf::LogFormatter:
rwsf::HandleBase

Public Member Functions

std::string format (Logger::LogLevel level, const std::string &message)
std::string getEpilog () const
std::string getProlog () const
Public Member Functions inherited from rwsf::HandleBase
bool isValid (void) const
bool operator!= (const HandleBase &second) const
bool operator== (const HandleBase &second) const

Additional Inherited Members

Protected Member Functions inherited from rwsf::HandleBase
 HandleBase (BodyBase *body)
 HandleBase (const HandleBase &second)
 HandleBase (StaticCtor)
 HandleBase (void)
virtual ~HandleBase (void)
BodyBase & body (void) const
HandleBaseoperator= (const HandleBase &second)

Detailed Description

Log Formatters are used to reformat log messages with extra logging details, such as a timestamp or the logging level of the message. To set up an rwsf::LogFormatter for use, place the proper create method for the specific formatter in your loggers configuration file (typically <installdir>\conf\loggers.xml):

<logger name="logger" class="rwsf_core.createFileLogger">
<property name="filename" value="${RWSF_HOME}/logs/agent.log"/>
<property name="formatter" value="rwsf_core.create[LogFormatterClass]"/>
</logger>

Log Formatters should not be constructed in code. Instead use the appropriate configuration file as shown above.

See specific log formatter implementations for more information. Currently the only available implementation is rwsf::LogTimeFormatter.

Member Function Documentation

◆ format()

std::string rwsf::LogFormatter::format ( Logger::LogLevel level,
const std::string & message )

Formats the given logger message with log level level. The message should be a printable std::string.

◆ getEpilog()

std::string rwsf::LogFormatter::getEpilog ( ) const

Returns the epilog that is appended to every log message.

◆ getProlog()

std::string rwsf::LogFormatter::getProlog ( ) const

Returns the prolog that is prepended to every log message.

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.