HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions
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 (void)
 
 HandleBase (StaticCtor)
 
 HandleBase (BodyBase *body)
 
 HandleBase (const HandleBase &second)
 
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

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.

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

Returns the epilog that is appended to every log message.

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

Returns the prolog that is prepended to every log message.

Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.