class Logger

Logger.

Public Methods

[more]virtual ~Logger ()
Destroys this object
[more]static bool hasBeenInitialized ()
Returns true if init has been called.
[more]static Logger* init (const string& id, string& message)
Returns a Logger given an identity string specified by id.
[more]static Logger* init (const string& id, const Properties& props, string& message)
[more]static int write (int level, const string& key, const string& message)
Writes this log to the destination provided that level is less than or equal to the logging level specified in the config file.
[more]static int setLevel (int level)
Sets the logging level for this Logger to level.
[more]static void flush ()

Protected Methods

[more]virtual int doWrite (int, const string&, const string&, const string&)
[more]virtual int doSetLevel (int)
[more]virtual void doFlush ()


Documentation

Logger.

ovirtual ~Logger()
Destroys this object

ostatic bool hasBeenInitialized()
Returns true if init has been called.

Returns:
true if already initialized.

ostatic Logger* init(const string& id, string& message)
Returns a Logger given an identity string specified by id. This identity string will be included in all the subsequent logs and, if possible, it should indicate who is making the request for access i.e. the remote host that the request comes from and/or the distinguished name of the requestor. This Logger must be freed by the caller.

We support 4 logging destinations server, file, stderr, stdout. The destination parameters are loaded from the system properties. The default is stderr.

Note NULL is returned if we are unable to open logs destination.

Throws:
Error if logger has been initialized or bad memory allocation
Parameters:
id - identity string that will be included in each log message
message - string out parameter that stores the outcome of init
Returns:
a logger that must be freed by the caller.
See Also:
getSystemProperties()

ostatic Logger* init(const string& id, const Properties& props, string& message)

ostatic int write(int level, const string& key, const string& message)
Writes this log to the destination provided that level is less than or equal to the logging level specified in the config file.

Note: No logs will be writen if a successful call to init(...) has not been made.

Parameters:
level - int logging level of this message
keyword - string application-specific event label
message - string message to be logged
See Also:
setLogLevel()

ostatic int setLevel(int level)
Sets the logging level for this Logger to level. All write(...) calls include as their first argument a logging level. Only writes with a logging level less than level will be logged. This allows a program to change at runtime how much logging to perform

Parameters:
level - int the new logging level for this logger
Returns:
the old logging level
See Also:
write(int, const string&, const string&).

ostatic void flush()

ovirtual int doWrite(int, const string&, const string&, const string&)

ovirtual int doSetLevel(int)

ovirtual void doFlush()


This class has no child classes.
Author:
Mary Thompson Gary Hoo Abdelilah Essiari
Version:
1.1 05/24/01

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.