From e8e21b31e37d9d34f24a5d4e5024d0583d835b4e Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 27 Jul 2012 17:27:47 +0000 Subject: [PATCH] Add debug_level_is_enabled() --- errlog.c | 19 ++++++++++++++++++- errlog.h | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/errlog.c b/errlog.c index 6e31e68d..e094ddd5 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.113 2012/03/09 16:23:50 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.114 2012/03/09 17:55:50 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -244,6 +244,23 @@ void set_debug_level(int debug_level) } +/********************************************************************* + * + * Function : debug_level_is_enabled + * + * Description : Checks if a certain debug level is enabled. + * + * Parameters : 1: debug_level = The debug level to check. + * + * Returns : Nothing. + * + *********************************************************************/ +int debug_level_is_enabled(int debug_level) +{ + return (0 != (debug & debug_level)); +} + + /********************************************************************* * * Function : disable_logging diff --git a/errlog.h b/errlog.h index 8fac4e6f..69341371 100644 --- a/errlog.h +++ b/errlog.h @@ -1,6 +1,6 @@ #ifndef ERRLOG_H_INCLUDED #define ERRLOG_H_INCLUDED -#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.26 2010/07/26 11:30:09 fabiankeil Exp $" +#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.27 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.h,v $ @@ -66,6 +66,7 @@ extern "C" { extern void init_error_log(const char *prog_name, const char *logfname); extern void set_debug_level(int debuglevel); +extern int debug_level_is_enabled(int debuglevel); extern void disable_logging(void); extern void init_log_module(void); extern void show_version(const char *prog_name); -- 2.39.2