Re: [PATCH 1/2] logging: Strip '\n' at the end of syslog() calls
- From: Dan Williams <dcbw redhat com>
- To: Ozan Çağlayan <ozan pardus org tr>
- Cc: networkmanager-list gnome org
- Subject: Re: [PATCH 1/2] logging: Strip '\n' at the end of syslog() calls
- Date: Wed, 09 Feb 2011 10:54:26 -0600
On Mon, 2011-02-07 at 22:45 +0200, Ozan Çağlayan wrote:
> syslog already ensures that the messages are splitted by \n
> boundaries. Appending another \n in NM pollutes the logging:
Pushed:
90493585795d8b60eab91bd1ed359d61b57617c6 (master)
251731ef5b17394fb0e99e8636672b9e6a5bb404 (0.8.4)
Thanks!
Dan
> Feb 7 22:00:55 2011 NetworkManager[890]: <info> ...
>
> Feb 7 22:00:56 2011 NetworkManager[890]: <info> ...
>
> Feb 7 22:00:57 2011 NetworkManager[890]: <warn> ...
>
> etc.
> ---
> src/logging/nm-logging.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c
> index 01bbb36..84cf16f 100644
> --- a/src/logging/nm-logging.c
> +++ b/src/logging/nm-logging.c
> @@ -237,14 +237,14 @@ void _nm_log (const char *loc,
>
> if ((log_level & LOGL_DEBUG) && (level == LOGL_DEBUG)) {
> g_get_current_time (&tv);
> - syslog (LOG_INFO, "<debug> [%ld.%ld] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg);
> + syslog (LOG_INFO, "<debug> [%ld.%ld] [%s] %s(): %s", tv.tv_sec, tv.tv_usec, loc, func, msg);
> } else if ((log_level & LOGL_INFO) && (level == LOGL_INFO))
> - syslog (LOG_INFO, "<info> %s\n", msg);
> + syslog (LOG_INFO, "<info> %s", msg);
> else if ((log_level & LOGL_WARN) && (level == LOGL_WARN))
> - syslog (LOG_WARNING, "<warn> %s\n", msg);
> + syslog (LOG_WARNING, "<warn> %s", msg);
> else if ((log_level & LOGL_ERR) && (level == LOGL_ERR)) {
> g_get_current_time (&tv);
> - syslog (LOG_ERR, "<error> [%ld.%ld] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg);
> + syslog (LOG_ERR, "<error> [%ld.%ld] [%s] %s(): %s", tv.tv_sec, tv.tv_usec, loc, func, msg);
> }
> g_free (msg);
> }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]