- Inherits from:
- Object
- Conforms to:
- DLogger
- Declared in:
- DTextWritableLogger.h
Object
|
+---DTextWritableLogger
Class Description
The DTextWritableLogger class implements methods for a continuous logging
to a class implementing the protocol DTextWritable. The logger changes
identical sequential log messages to two lines: first the message and then a line
with the number of occurences. The layout of the log line is:
yyyy-mm-dd hh:mm:ss.mmm message.
- Last modified:
- 23-Jul-2006 (DTextWritableLogger.h)
Instance Variables
- protected unsigned _mask
- the active mask
- protected id<DTextWritable> _writer
- the reference to the writer
- protected DText *_previous
- the previous message
- protected DDateTime *_time
- the time
- protected long _repeated
- the number of identical messages
- protected DText *_output
- the output for the logger
- Constructors
- - (DTextWritableLogger *) init
- Initialise an empty logger
- Returns:
- the object
- - (DTextWritableLogger *) init :(id <DTextWritable>) writer
- Initialise a logger with a writter
- Parameters:
- writer - the writer for the logger
- Returns:
- the object
- Copy constructor
- - shallowCopy
- Do a shallow copy of the object
- Returns:
- the object
- Deconstructor
- - free
- Free the object
- Returns:
- the object
- Member methods
- - (DTextWritableLogger *) writer :(id<DTextWritable>) writer
- Set the writer for the logger
- Parameters:
- writer - the writer for the logger
- Returns:
- the object
- Implementation of interface DLogger
- - (BOOL) doLog :(int) level :(const char *) message
- Log an event by the logger
- Parameters:
- level - the level of the event
message - the message to be logged
- Returns:
- success
- - (BOOL) format :(DText *) output :(DDateTime *) dateTime :(int) level :(const char *) message
- Format the output of the event (to be overridden for different format)
- Parameters:
- output - the output of the formatting of the event
dateTime - the date/time of the event
level - the level of the event
message - the message of the event
- Returns:
- success
- - (int) mask :(int) levels
- Set the active levels
- Parameters:
- level - the bitwise or'ed active levels
- Returns:
- the previous mask
- - (int) mask :(int) high :(int) low
- Set the active level range
- Parameters:
- high - the highest active level
low - the lowest active level
- Returns:
- the previous mask
- - (BOOL) writeEvent :(int) level :(const char *) message
- Write a event in the writer
- Parameters:
- level - the level of the event
message - the message of the event
- Returns:
- success
generated 25-Jul-2006 by ObjcDoc 3.0.0