decaf::util::logging::Handler Class Reference
A Handler object takes log messages from a Logger and exports them.
More...
#include <src/main/decaf/util/logging/Handler.h>
Detailed Description
A Handler object takes log messages from a Logger and exports them.
It might for example, write them to a console or write them to a file, or send them to a network logging service, or forward them to an OS log, or whatever.
A Handler can be disabled by doing a setLevel(Level.OFF) and can be re-enabled by doing a setLevel with an appropriate level.
Handler classes typically use LogManager properties to set default values for the Handler's Filter, Formatter, and Level. See the specific documentation for each concrete Handler class.
Constructor & Destructor Documentation
| decaf::util::logging::Handler::Handler |
( |
|
) |
|
| virtual decaf::util::logging::Handler::~Handler |
( |
|
) |
[virtual] |
Member Function Documentation
| virtual void decaf::util::logging::Handler::flush |
( |
|
) |
[pure virtual] |
| virtual ErrorManager* decaf::util::logging::Handler::getErrorManager |
( |
|
) |
[inline, virtual] |
| virtual Filter* decaf::util::logging::Handler::getFilter |
( |
|
) |
[inline, virtual] |
| virtual Formatter* decaf::util::logging::Handler::getFormatter |
( |
|
) |
[inline, virtual] |
| virtual Level decaf::util::logging::Handler::getLevel |
( |
|
) |
[inline, virtual] |
Get the log level specifying which message levels will be logged by this Handler.
- Returns:
- Level enumeration value
| virtual bool decaf::util::logging::Handler::isLoggable |
( |
const LogRecord & |
record |
) |
const [virtual] |
| virtual void decaf::util::logging::Handler::publish |
( |
const LogRecord & |
record |
) |
[pure virtual] |
| void decaf::util::logging::Handler::reportError |
( |
const std::string & |
message, |
|
|
decaf::lang::Exception * |
ex, |
|
|
int |
code | |
|
) |
| | [protected] |
Protected convenience method to report an error to this Handler's ErrorManager.
- Parameters:
-
| message | - a descriptive string (may be empty) |
| ex | - an exception (may be NULL) |
| code | - an error code defined in ErrorManager |
| virtual void decaf::util::logging::Handler::setErrorManager |
( |
ErrorManager * |
errorManager |
) |
[virtual] |
Sets the Formatter used by this Handler.
The ErrorManager's "error" method will be invoked if any errors occur while using this Handler.
- Parameters:
-
| virtual void decaf::util::logging::Handler::setFilter |
( |
Filter * |
filter |
) |
[inline, virtual] |
Sets the Filter that this Handler uses to filter Log Records.
For each call of publish the Handler will call this Filter (if it is non-null) to check if the LogRecord should be published or discarded.
- Parameters:
-
| filter | Filter derived instance |
| virtual void decaf::util::logging::Handler::setFormatter |
( |
Formatter * |
formatter |
) |
[virtual] |
Sets the Formatter used by this Handler.
Some Handlers may not use Formatters, in which case the Formatter will be remembered, but not used.
- Parameters:
-
| formatter | Filter derived instance |
| virtual void decaf::util::logging::Handler::setLevel |
( |
const Level & |
value |
) |
[inline, virtual] |
Set the log level specifying which message levels will be logged by this Handler.
The intention is to allow developers to turn on voluminous logging, but to limit the messages that are sent to certain Handlers.
- Parameters:
-
| value | Level enumeration value |
The documentation for this class was generated from the following file: