On Thu, Oct 08, 2015 at 05:00:08PM +0200, Harald Welte wrote:
Hi Neels,
On Wed, Oct 07, 2015 at 04:18:19PM +0200, Neels Hofmeyr wrote:
+#define LOGERR(fmt, args...) \
+ LOGP(DGTPHUB, LOGL_ERROR, fmt, ##args)
+
+#define LOG(fmt, args...) \
+ LOGP(DGTPHUB, LOGL_NOTICE, fmt, ##args)
we typically don't do this in the Osmo* codebase,bt use the full
statement. However, it is your choice.
The problem I see with this is that you reduce/remove the flexibility of
using multiplelog subsstems and levels. You more or less assume that
there will always only be two log levels used, and all messages will use
the same subsystem. Is that really the case?
It's intended as a per-C-file local definition just to reduce repetition.
If a file needs another log level (more than once), I intend to create
another LOGxxx #define; but never in an h. LOGP() is also available.
When the full statement is used everytime, it is also
easier to later
change / tune the logging levels of certain statements, which is
typically what happens after you run it in production with thousands of
messages flowing through and you see what kind of granularity makes
sense.
ok, I see. I'll drop them as I go, then.
Also, I think in patch 10/10 you state 'add debug
messages' but then
use the LOG() macro. So in fact you are adding NOTICE messages, not
DEBUG messages. So either of the two statements is wrong.
That's right. Most current LOG()s are actually not intended to live past
the commit that concludes GTP transcoding, fairly soon. That's what I
meant by debug, really.
Thanks!
~Neels