c++.stlsoft - Log message prefix
- Lars Ivar Igesund (5/5) Apr 18 2008 I'm not to "happy" with with the standard prefix format of the log messa...
- Matthew Wilson (26/31) Apr 20 2008 First, the "official" way of doing it is only the way adopted by the sto...
- Lars Ivar Igesund (12/51) Apr 20 2008 examples/cpp/example.cpp.tracing.with_function/example.cpp.tracing.with_...
- Matthew Wilson (5/15) Apr 25 2008 Still not sure what you mean.
I'm not to "happy" with with the standard prefix format of the log message, and so I wonder what would be the best approach to customize it. Typically I'm after something along the lines of Timestamp, threadid, severity name - message itself In addition to the above trace info (file and/or function name) may be relevant, possibly depending on severity. The severity names themselves will be defined in the application. Lars Ivar
Apr 18 2008
I'm not to "happy" with with the standard prefix format of the logmessage, and so I wonder what would be the best approach to customize it.Typically I'm after something along the lines of Timestamp, threadid, severity name - message itselfFirst, the "official" way of doing it is only the way adopted by the stock back-ends. It's important to note that Pantheios is designed as a logging API, and the user is intended (and encouraged) to implement their own back-end, which could/would prepare the output statement formats in whatever way they deemed fit. The stock back-ends (and the de-facto standard formatting) is just there as a convenience to users, not in any way any officially prescribed or recommended way. In some of the commercial customisations of front-/back-end systems that I've done the clients have had a variety of different requirements - some including all the fields you list - all of which are reasonably easily achieved.In addition to the above trace info (file and/or function name) may berelevant, possibly depending on severity. This can be achieved by using the Trace API for the ones you want file+line for, e.g. perhaps DEBUG, INFO and NOTICE. To get __FUNCTION__ in, you can override (via the pre-processor). Check out the examples/cpp/example.cpp.tracing.with_function/example.cpp.tracing.with_func tion.cpp example.The severity names themselves will be defined in the application.This is quite a bit more invasive. One client's had me do this for them, but it involved a degree of effort, as it was not something anticipated in the original Pantheios design (which assumes known-at-compile-time severity names in order to have absolute maximum name processing efficiency). HTH Matt
Apr 20 2008
Matthew Wilson wrote:Yes, I'm already on to this.I'm not to "happy" with with the standard prefix format of the logmessage, and so I wonder what would be the best approach to customize it.Typically I'm after something along the lines of Timestamp, threadid, severity name - message itselfFirst, the "official" way of doing it is only the way adopted by the stock back-ends. It's important to note that Pantheios is designed as a logging API, and the user is intended (and encouraged) to implement their own back-end, which could/would prepare the output statement formats in whatever way they deemed fit. The stock back-ends (and the de-facto standard formatting) is just there as a convenience to users, not in any way any officially prescribed or recommended way. In some of the commercial customisations of front-/back-end systems that I've done the clients have had a variety of different requirements - some including all the fields you list - all of which are reasonably easily achieved.examples/cpp/example.cpp.tracing.with_function/example.cpp.tracing.with_funcIn addition to the above trace info (file and/or function name) may berelevant, possibly depending on severity. This can be achieved by using the Trace API for the ones you want file+line for, e.g. perhaps DEBUG, INFO and NOTICE. To get __FUNCTION__ in, you can override (via the pre-processor). Check out thetion.cpp example.Yup.Not sure I understand you fully here - the names will be known at compile time. They will just not be exactly the same as the predefined ones (DEBUG, INFO, etc) - but rather augmentations of those like INFO_1, INFO_2, etc -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the TangoThe severity names themselves will be defined in the application.This is quite a bit more invasive. One client's had me do this for them, but it involved a degree of effort, as it was not something anticipated in the original Pantheios design (which assumes known-at-compile-time severity names in order to have absolute maximum name processing efficiency).
Apr 20 2008
Still not sure what you mean. Can you enumerate the full list of desired severity levels and, if possible, indicate their equivalents in the stock (Syslog-based) eight levels. Cheers MattNot sure I understand you fully here - the names will be known at compile time. They will just not be exactly the same as the predefined ones (DEBUG, INFO, etc) - but rather augmentations of those like INFO_1, INFO_2, etcThe severity names themselves will be defined in the application.This is quite a bit more invasive. One client's had me do this for them, but it involved a degree of effort, as it was not something anticipated in the original Pantheios design (which assumes known-at-compile-time severity names in order to have absolute maximum name processing efficiency).
Apr 25 2008