SimpleLayout Class Reference

Inheritance diagram for SimpleLayout:

Inheritance graph
[legend]
Collaboration diagram for SimpleLayout:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void format (ostream &output, const spi::LoggingEventPtr &event) const
bool ignoresThrowable () const
virtual void activateOptions ()
virtual void setOption (const String &option, const String &value)

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 (  )  [inline, virtual]

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.

void format ( ostream &  output,
const spi::LoggingEventPtr event 
) const [virtual]

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

 INFO - "A message"
		

The category parameter is ignored.

Returns:
A byte array in SimpleLayout format.

Implements Layout.

bool ignoresThrowable (  )  const [inline, virtual]

The SimpleLayout does not handle the throwable contained within LoggingEvents. Thus, it returns true.

Implements Layout.

virtual void setOption ( const String &  option,
const String &  value 
) [inline, virtual]

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 files:
Generated on Thu Sep 28 17:03:59 2006 for log4cxx by  doxygen 1.4.7