[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4282) [enhancement] severity-aware logging



Full_Name: Pierangelo Masarati
Version: HEAD
OS: (almost) irrelevant
URL: http://www.sys-net.it/~ando/Download/debug-2005-12-22.patch.bz2
Submission from: (NULL) (81.72.89.40)
Submitted by: ando


The attached patch contains an enhancement that introduces the capability to log
to syslog in a severity-aware manner; the original logging behavior is preserved
by defining OLD_DEBUG at compile time.

A new set of macros LogN() and StatslogN() (currently with N ranging 1-3 for 1-3
args in format, to silence the format warning issued by some compilers; larger
argnumbers may be easily added if required) accept the severity as an extra
argument.  The original Debug() and Statslog() macros are preserved; they
default to logging at ldap_syslog_level severity level, which defaults to
LOG_DEBUG and can now be set by the "-S" switch (a level of "INFO" may be more
appropriate if loglevel is not too verbose).

The attached patch simply sets up the infrastructure, providing the new logging
macros and the severity levels; no use of the new macros is done yet within the
code.
If it looks acceptable, I'd like to commit it and start moving relevant messages
under the new macros, prioritized on severity.

The rationale is to use the loglevel to select subsystem logging at informative
levels, like LDAP_LEVEL_INFO or LDAP_LEVEL_DEBUG; messages with very high
priority should be logged with LDAP_DEBUG_ANY loglevel, so that they get always
logged according to the severity, unless other considerations suggest to
restrict them.

There is no provisions yet to handle --disable-debug.

See <http://www.openldap.org/lists/openldap-devel/200512/msg00075.html> for
discussion, and <http://www.openldap.org/lists/openldap-devel/200509/msg00042.html>
for the original message.

p.