diff options
author | mifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-22 22:55:52 +0000 |
---|---|---|
committer | mifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-22 22:55:52 +0000 |
commit | c1eb1a369073742ce962dcaba73c73b0cdddcc93 (patch) | |
tree | 59a46edf259f271822e35aeba22ddb1107a16c0d /src/helper/log.c | |
parent | 34424b4bb532437f61f64e650b42883e1f4d1ee7 (diff) | |
download | riscv-openocd-c1eb1a369073742ce962dcaba73c73b0cdddcc93.zip riscv-openocd-c1eb1a369073742ce962dcaba73c73b0cdddcc93.tar.gz riscv-openocd-c1eb1a369073742ce962dcaba73c73b0cdddcc93.tar.bz2 |
- added patch to remove count and time information from log_printf
in case of debug_level is not set to LOG_DEBUG
git-svn-id: svn://svn.berlios.de/openocd/trunk@320 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper/log.c')
-rw-r--r-- | src/helper/log.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/helper/log.c b/src/helper/log.c index fe47513..b2f31dc 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -69,7 +69,17 @@ void log_printf(enum log_levels level, const char *file, int line, const char *f if (f != NULL) file = f + 1; - fprintf(log_output, "%s %d %ld %s:%d %s(): %s\n", log_strings[level+1], count, time(NULL), file, line, function, buffer); + if (debug_level >= LOG_DEBUG) + { + /* print with count and time information */ + fprintf(log_output, "%s %d %ld %s:%d %s(): %s\n", log_strings[level+1], count, time(NULL), file, line, function, buffer); + } + else + { + /* do not print count and time */ + fprintf(log_output, "%s %s:%d %s(): %s\n", log_strings[level+1], file, line, function, buffer); + } + fflush(log_output); va_end(args); |