Package: liblog4cxx10-dev
Version: 0.10.0-1
Severity: wishlist
The log4cxx macros are complete statements (not needing a trailing
semicolon) so you must use them like this:
LOG4CXX_INFO(logger, "This is a message")
rather than like this:
LOG4CXX_INFO(logger, "This is a message");
This is somewhat inconvenient and causes editors to get confused
about how much to indent the next line.
You can actually write the second one a lot of the time, but it's not
guaranteed to work; e.g., try this out:
if(blah)
LOG4CXX_INFO(logger, "This is a message");
else
doSomething();
That will produce a surprising error message about your "else" not
having a corresponding "if", because it expanded to:
if(blah)
{ /* log4cxx stuff */ };
else
doSomething();
(note the trailing semicolon in the first "if" clause)
The standard remedy for this problem is to use "do { ... } while(0)"
around the macro statements, and I'll probably make my own macros that
do just that. It would be nice if log4cxx had standard macros which
were a little more robust, or alternatively if this "feature" was
documented in the short intro to log4cxx.
Daniel
-- System Information:
Debian Release: 5.0
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages liblog4cxx10-dev depends on:
ii libapr1-dev 1.2.12-5 The Apache Portable Runtime Librar
ii libaprutil1-dev 1.2.12+dfsg-8 The Apache Portable Runtime Utilit
ii liblog4cxx10 0.10.0-1 A logging library for C++
liblog4cxx10-dev recommends no packages.
Versions of packages liblog4cxx10-dev suggests:
ii liblog4cxx10-doc 0.10.0-1 Documentation for log4cxx
ii pkg-config 0.22-1 manage compile and link flags for
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]