summaryrefslogtreecommitdiff
path: root/src/helper/log.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-03-13 08:17:01 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-03-13 08:17:01 +0000
commita3dbb9cee672e4c3d5e526b6b2a847e78c06b637 (patch)
tree4632c5a4e343f06cc8fc547556f3bb6b4db9c638 /src/helper/log.c
parentb8dab6d056e4c9d9964e8958717692e030235aac (diff)
downloadopenocd_libswd-a3dbb9cee672e4c3d5e526b6b2a847e78c06b637.tar.gz
openocd_libswd-a3dbb9cee672e4c3d5e526b6b2a847e78c06b637.tar.bz2
openocd_libswd-a3dbb9cee672e4c3d5e526b6b2a847e78c06b637.tar.xz
openocd_libswd-a3dbb9cee672e4c3d5e526b6b2a847e78c06b637.zip
print ms in debug_level 3 logs. Seconds is not enough.
git-svn-id: svn://svn.berlios.de/openocd/trunk@510 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper/log.c')
-rw-r--r--src/helper/log.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/helper/log.c b/src/helper/log.c
index cb45a7eb..03fecc20 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -35,7 +35,7 @@ int debug_level = -1;
static FILE* log_output;
static log_callback_t *log_callbacks = NULL;
-static time_t start;
+static long long start;
static char *log_strings[5] =
{
@@ -77,7 +77,7 @@ static void log_puts(enum log_levels level, const char *file, int line, const ch
if (debug_level >= LOG_DEBUG)
{
/* print with count and time information */
- int t=(int)(time(NULL)-start);
+ int t=(int)(timeval_ms()-start);
fprintf(log_output, "%s %d %d %s:%d %s(): %s", log_strings[level+1], count, t, file, line, function, string);
}
else
@@ -191,7 +191,7 @@ int handle_log_output_command(struct command_context_s *cmd_ctx, char *cmd, char
int log_register_commands(struct command_context_s *cmd_ctx)
{
- start = time(NULL);
+ start = timeval_ms();
register_command(cmd_ctx, NULL, "log_output", handle_log_output_command,
COMMAND_ANY, "redirect logging to <file> (default: stderr)");
register_command(cmd_ctx, NULL, "debug_level", handle_debug_level_command,