diff options
| author | Venky Shankar <venky@gluster.com> | 2011-04-25 03:10:01 +0000 | 
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2011-05-20 11:01:49 -0700 | 
| commit | 2cd8411a0278f98ed820aad3e482de079d0540c0 (patch) | |
| tree | 66cd9fa15fe8d269277b41469c3f45a12f59c24b /libglusterfs | |
| parent | 03c58c782d99440a5947289d0ff216bca8ef7c57 (diff) | |
cli log level command and per translator log level
Signed-off-by: Venky Shankar <venky@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2714 (implement cli log level command)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2714
Diffstat (limited to 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/logging.c | 39 | 
1 files changed, 18 insertions, 21 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c index eaa735d5f03..550aadef120 100644 --- a/libglusterfs/src/logging.c +++ b/libglusterfs/src/logging.c @@ -196,19 +196,18 @@ _gf_log_nomem (const char *domain, const char *file,          xlator_t       *this            = NULL;          struct timeval  tv              = {0,};          int             ret             = 0; -        gf_loglevel_t   xlator_loglevel = 0;          char            msg[8092];          char            timestr[256];          char            callstr[4096];          this = THIS; -        xlator_loglevel = this->loglevel; -        if (xlator_loglevel == 0) -                xlator_loglevel = loglevel; - -        if (level > xlator_loglevel) -                goto out; +        if (gf_log_xl_log_set) { +                if (this->loglevel && (level > this->loglevel)) +                        goto out; +                else if (level > gf_log_loglevel) +                        goto out; +        }          static char *level_strings[] = {"",  /* NONE */                                          "M", /* EMERGENCY */ @@ -318,17 +317,16 @@ _gf_log_callingfn (const char *domain, const char *file, const char *function,          struct timeval  tv              = {0,};          size_t          len             = 0;          int             ret             = 0; -        gf_loglevel_t   xlator_loglevel = 0;          va_list         ap;          this = THIS; -        xlator_loglevel = this->loglevel; -        if (xlator_loglevel == 0) -                xlator_loglevel = loglevel; - -        if (level > xlator_loglevel) -                goto out; +        if (gf_log_xl_log_set) { +                if (this->loglevel && (level > this->loglevel)) +                        goto out; +                else if (level > gf_log_loglevel) +                        goto out; +        }          static char *level_strings[] = {"",  /* NONE */                                          "M", /* EMERGENCY */ @@ -465,16 +463,15 @@ _gf_log (const char *domain, const char *file, const char *function, int line,          size_t       len  = 0;          int          ret  = 0;          xlator_t    *this = NULL; -        gf_loglevel_t xlator_loglevel = 0;          this = THIS; -        xlator_loglevel = this->loglevel; -        if (xlator_loglevel == 0) -                xlator_loglevel = loglevel; - -        if (level > xlator_loglevel) -                goto out; +        if (gf_log_xl_log_set) { +                if (this->loglevel && (level > this->loglevel)) +                        goto out; +                else if (level > gf_log_loglevel) +                        goto out; +        }          static char *level_strings[] = {"",  /* NONE */                                          "M", /* EMERGENCY */  | 
