Re: rrdcached foreground logging

Frederik Kriewitz <[email protected]>
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
On Sat, Jul 10, 2010 at 9:28 AM, Tobias Oetiker <[email protected]> wrote:
> Hi Bernard,
>
> Yesterday Bernard Li wrote:
>
>> Hi all:
>>
>> The following patch adds a new line per log message when running
>> rrdcached in foreground:
>>
>> Index: src/rrd_daemon.c
>> ===================================================================
>> --- src/rrd_daemon.c    (revision 2114)
>> +++ src/rrd_daemon.c    (working copy)
>> @@ -115,7 +115,7 @@
>>  #define RRDD_LOG(severity, ...) \
>>    do { \
>>      if (stay_foreground) \
>> -      fprintf(stderr, __VA_ARGS__); \
>> +      fprintf(stderr, "%s\n", __VA_ARGS__); \
>>      syslog ((severity), __VA_ARGS__); \
>>    } while (0)
>
> would this not expand from
>
>  RRDD_LOG(LOG_NOTICE, "caught SIG%s", sig);
>
> to
>
>  fprintf(stderr, "%s\n", "caught SIG%s", sig);
>
> and this would print
>
>  "caught SIG%s\n"
>
> or am I missing something clever here ?

I don't think that will work, too.
I fixed this for me by simply adding a
fprintf(stderr, "\n"); \

If there's a better solution, please let me know.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.