pcp
[Top] [All Lists]

Re: [pcp] Lustrecomm - Consistent use of __pmNotify API

To: Scott Emery <emery@xxxxxxx>
Subject: Re: [pcp] Lustrecomm - Consistent use of __pmNotify API
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Tue, 12 Oct 2010 22:22:54 +1100 (EST)
Cc: pcp@xxxxxxxxxxx
In-reply-to: <201010090004.o9904niq1621343@xxxxxxxxxxxxxxxxxxxxx>
----- "Scott Emery" <emery@xxxxxxx> wrote:

> From 1d48e2c6181cc9e4a0b9003c0092a29eaafb4999 Mon Sep 17 00:00:00
> 2001
> From: root <root@xxxxxxxxxxxxxxxxx>
> Date: Fri, 2 Jul 2010 15:17:48 -0700
> Subject: [PATCH 3/5] lustrecomm - error handling should use the
> __pmNotify API for consistent and
>    timestamped messages
> 
> ---
>  src/pmdas/lustrecomm/file_indexed.c |    2 +-
>  src/pmdas/lustrecomm/file_single.c  |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/pmdas/lustrecomm/file_indexed.c
> b/src/pmdas/lustrecomm/file_indexed.c
> index b326335..ecfe053 100644
> --- a/src/pmdas/lustrecomm/file_indexed.c
> +++ b/src/pmdas/lustrecomm/file_indexed.c
> @@ -107,7 +107,7 @@ int file_indexed (struct file_state *f_s, int
> type, int *base, void **vpp, int i
>       break;
>      case PM_TYPE_NOSUPPORT:
>      default:
> -     fprintf(stderr,"file_indexed: type %d not supported\n", type);
> +     __pmNotifyErr(LOG_ERR,"file_indexed: type %d not supported\n",
> type);
>       break;
>      }
>      /* so, write it up and slice and dice */
> diff --git a/src/pmdas/lustrecomm/file_single.c
> b/src/pmdas/lustrecomm/file_single.c
> index 224dfe7..6c2a567 100644
> --- a/src/pmdas/lustrecomm/file_single.c
> +++ b/src/pmdas/lustrecomm/file_single.c
> @@ -130,7 +130,7 @@ int file_single (char *filename, int type, int
> *base, void **vpp)
>       break;
>      case PM_TYPE_NOSUPPORT:
>      default:
> -     fprintf(stderr,"file_single: type %d not supported\n", type);
> +     __pmNotifyErr(stderr,"file_single: type %d not supported\n", type);
>       break;
>      }
>      return 0;

This last bit looks incorrect BTW Scott - first argument to __pmNotifyErr is
a log level not a file descriptor (LOG_ERR would be appropriate here I guess).

cheers.

-- 
Nathan

<Prev in Thread] Current Thread [Next in Thread>