You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by "Moul, Russell G" <ru...@boeing.com> on 2004/12/17 23:38:43 UTC

Adding a custom logging level

The documentation states that you can add new levels by subclassing
Level, but eludes to a better way.  I didn't see the better way.  I've
subclassed Level and am unsure how the DECLARE_LOG4CXX_LEVEL and
IMPLEMENT_LOG4CXX_LEVEL macros are used.

An example of a custom logging level would be great!

Russ

Re: Adding a custom logging level

Posted by Curt Arnold <ca...@apache.org>.
Some of the more cryptic comments were copied over from log4j and may 
or may not apply to log4j   If the same comments appear in the log4j 
source you might search the log4j mailing lists and ask there.  There 
is definitely a more continuous history there.  I personally can't tell 
you what happened in log4cxx more than a few months back.

The unit tests in tests/src/customlogger define an extended Level class 
(XLevel defined in tests/src/xml/xlevel.h and .cpp) with two additional 
levels (LETHAL and TRACE).


On Dec 17, 2004, at 4:38 PM, Moul, Russell G wrote:

> The documentation states that you can add new levels by subclassing
> Level, but eludes to a better way.  I didn't see the better way.  I've
> subclassed Level and am unsure how the DECLARE_LOG4CXX_LEVEL and
> IMPLEMENT_LOG4CXX_LEVEL macros are used.
>
> An example of a custom logging level would be great!
>
> Russ
>