#include <log.hh>
Inheritance diagram for Qmms::Log::PatternLayout::

Public Methods | |
| PatternLayout () | |
| Default constuctor uses default values for pattern and date/time format. More... | |
| PatternLayout (const QString &ptn) | |
| Constructor. More... | |
| ~PatternLayout () | |
| Destructor does nothing. More... | |
| QString | formatEvent (const LoggingEvent *evnt) |
| Takes a LoggingEvent and formats its members according to the pattern of tokens/text. More... | |
| bool | changePattern (const QString ptn) |
| Changes the pattern to the one provided. More... | |
| QString | getPattern () const |
| Accessor method. More... | |
| QString | getDate (const LoggingEvent *evnt) const |
| Given a LoggingEvent, gets its date/time and formats according to the date/time format. More... | |
| bool | changeDateTimeFormat (const QString format) |
| Changes the date/time format to the given one. More... | |
Private Methods | |
| bool | isValidPattern (const QString ptn) |
| Checks whether the given string qualifies as a valid pattern. More... | |
Private Attributes | |
| QString | pattern |
| The pattern of tokens and text to be used. More... | |
| QString | dtFormat |
| The date/time format. More... | |
Static Private Attributes | |
| const QString | DEFAULT_PATTERN |
Default patturn is: /d /c /p. More... | |
| const QString | DEFAULT_DATETIME_FORMAT |
Default date/time format is ddd dd MMM hh:mm:ss yyyy. More... | |
The tokens are preceded by a slash / and can be any of the following:
/c - name of category /C - fully-qualified name of class within which logging occured /d - date/time of logging event /m - message to log /l - level of logging event /n - start a new lineOne can include other text anywhere in the pattern. E.g., to print the following:
(Tue 15 Jan 17:38:50 2002) cat-WARN: This is a warn
use the pattern
(/d) /c-/l: /m /n
|
|
Default constuctor uses default values for pattern and date/time format.
|
|
|
Constructor.
|
|
|
Destructor does nothing.
|
|
|
Changes the date/time format to the given one. No attempt is made to check format for validity; make sure your formats are correct. See docs for QDateTime::toString() for description of formats.
|
|
|
Changes the pattern to the one provided. Checks the new pattern for validity before doing anything else.
|
|
|
Takes a LoggingEvent and formats its members according to the pattern of tokens/text.
Reimplemented from Qmms::Log::Layout. |
|
|
Given a LoggingEvent, gets its date/time and formats according to the date/time format.
|
|
|
Accessor method.
|
|
|
Checks whether the given string qualifies as a valid pattern.
|
|
|
Default date/time format is
|
|
|
Default patturn is:
|
|
|
The date/time format.
|
|
|
The pattern of tokens and text to be used.
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001