Apache log4cxx  Version 0.13.0
log4cxx::SimpleLayout Class Reference

SimpleLayout consists of the level of the log statement, followed by " - " and then the log message itself. More...

#include <simplelayout.h>

Inheritance diagram for log4cxx::SimpleLayout:
log4cxx::Layout log4cxx::spi::OptionHandler log4cxx::helpers::Object log4cxx::helpers::Object

Public Member Functions

virtual void format (LogString &output, const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool) const
 Returns the log statement in a format consisting of the level, followed by " - " and then the message. More...
 
bool ignoresThrowable () const
 The SimpleLayout does not handle the throwable contained within LoggingEvents. More...
 
virtual void activateOptions (log4cxx::helpers::Pool &)
 Activate the options that were previously set with calls to option setters. More...
 
virtual void setOption (const LogString &, const LogString &)
 Set option to value. More...
 
- Public Member Functions inherited from log4cxx::Layout
virtual ~Layout ()
 
virtual LogString getContentType () const
 Returns the content type output by this layout. More...
 
virtual void appendHeader (LogString &output, log4cxx::helpers::Pool &p)
 Append the header for the layout format. More...
 
virtual void appendFooter (LogString &output, log4cxx::helpers::Pool &p)
 Append the footer for the layout format. More...
 
- Public Member Functions inherited from log4cxx::spi::OptionHandler
virtual ~OptionHandler ()
 
- Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
 
virtual bool instanceof (const Class &clazz) const =0
 
virtual const void * cast (const Class &clazz) const =0
 

Detailed Description

SimpleLayout consists of the level of the log statement, followed by " - " and then the log message itself.

For example,

        DEBUG - Hello world

PatternLayout offers a much more powerful alternative.

Member Function Documentation

◆ activateOptions()

virtual void log4cxx::SimpleLayout::activateOptions ( log4cxx::helpers::Pool p)
inlinevirtual

Activate the options that were previously set with calls to option setters.

This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.

For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.

Implements log4cxx::spi::OptionHandler.

◆ format()

virtual void log4cxx::SimpleLayout::format ( LogString output,
const spi::LoggingEventPtr event,
log4cxx::helpers::Pool pool 
) const
virtual

Returns the log statement in a format consisting of the level, followed by " - " and then the message.

For example,

 INFO - "A message"
Returns
A byte array in SimpleLayout format.

Implements log4cxx::Layout.

◆ ignoresThrowable()

bool log4cxx::SimpleLayout::ignoresThrowable ( ) const
inlinevirtual

The SimpleLayout does not handle the throwable contained within LoggingEvents.

Thus, it returns true.

Implements log4cxx::Layout.

◆ setOption()

virtual void log4cxx::SimpleLayout::setOption ( const LogString option,
const LogString value 
)
inlinevirtual

Set option to value.

The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when activateOptions is called.

Implements log4cxx::spi::OptionHandler.


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