Apache log4cxx (Incubating)  Version 0.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
SimpleLayout Class Reference

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

Inheritance diagram for SimpleLayout:
Layout OptionHandler ObjectImpl Object 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 Layout
virtual ~Layout ()
 
void addRef () const
 
void releaseRef () const
 
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 OptionHandler
virtual ~OptionHandler ()
 
- Public Member Functions inherited from Object
virtual const helpers::ClassgetClass () const
 
virtual ~Object ()
 
virtual bool instanceof (const Class &clazz) const =0
 
virtual const void * cast (const Class &clazz) const =0
 
- Public Member Functions inherited from ObjectImpl
 ObjectImpl ()
 
virtual ~ObjectImpl ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static const helpers::ClassgetStaticClass ()
 
static const
log4cxx::helpers::ClassRegistration
registerClass ()
 
- Protected Attributes inherited from ObjectImpl
unsigned int volatile ref
 

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

virtual void 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 OptionHandler.

virtual void 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 Layout.

bool ignoresThrowable ( ) const
inlinevirtual

The SimpleLayout does not handle the throwable contained within LoggingEvents.

Thus, it returns true.

Implements Layout.

virtual void 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 OptionHandler.


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