It seems that dbg() and trace() are not used consistently within the
project and plugin code. The result is that there's quite a bit of
"SPAM" in the system logs, when OpenHPI is built with the default
options.
>From looking at include/oh_error.h:
dbg()
* Logs to syslog with the default options used for the daemon
build.
* Also prints to stderr if OPENHPI_DEBUG=YES is set in the
environment.
* Can be turned off if the project is compiled without OH_DBG_MSGS
trace()
* Prints to stderr if OPENHPI_DEBUG_TRACE=YES in the environment.
* Can be turned off if the project is compiled without OH_DBG_MSGS
Because dbg() is used for both debug messages, for example:
ipmi.cpp, 2265, ipmidirect discover_resources
and errors:
ipmi_sensor.c, 1368, out of memory
there isn't a way to turn off the tracing messages and still leave the
errors.
I see a couple of solutions:
1. Change dbg() calls to trace() calls, if the context is
informational, intended for development or debug. dbg() would
be reserved only for errors.
2. Add a third macro, something like err(), that would be for
errors. Go through the code and change all errors to use this
macro instead.
The second option would probably involve adding another compile option
to make errors silent. It is also a lot more invasive. The first seems
simpler, and changing a dbg() to a trace() should not upset things.
In the future, I may have some time to go through the code and try to
make this more consistent, but we should discuss the strategy here
first. Should we just make simple changes from dbg() to trace() as we
find these in the code, or is there need for a bigger effort, now that
OpenHPI is getting more mature and being used in production
environments?
--
Bryan Sutula <[EMAIL PROTECTED]>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel