diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2009-12-03 09:57:58 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-12-03 12:17:15 -0500 |
commit | 80bc946c83d630eae8e867d1a5960851836b0533 (patch) | |
tree | 647f8f5aecfceffd8ab9dd29d5eb62a97f9098de /server/util/util.h | |
parent | 068e7e9b945dd1c9c6bf20b191cb95af918836e0 (diff) | |
download | sssd-80bc946c83d630eae8e867d1a5960851836b0533.tar.gz sssd-80bc946c83d630eae8e867d1a5960851836b0533.tar.bz2 sssd-80bc946c83d630eae8e867d1a5960851836b0533.zip |
Make debug log timestamps human-readable
Diffstat (limited to 'server/util/util.h')
-rw-r--r-- | server/util/util.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/util/util.h b/server/util/util.h index b116a66a..7e9c182f 100644 --- a/server/util/util.h +++ b/server/util/util.h @@ -80,8 +80,12 @@ errno_t set_debug_file_from_fd(const int fd); #define DEBUG(level, body) do { \ if (level <= debug_level) { \ if (debug_timestamps) { \ - debug_fn("(%010ld) [%s] [%s] (%d): ", \ - (long)time(NULL), debug_prg_name, __FUNCTION__, level); \ + time_t rightnow = time(NULL); \ + char stamp[25]; \ + memcpy(stamp, ctime(&rightnow), 24); \ + stamp[24] = '\0'; \ + debug_fn("(%s) [%s] [%s] (%d): ", \ + stamp, debug_prg_name, __FUNCTION__, level); \ } else { \ debug_fn("[%s] [%s] (%d): ", \ debug_prg_name, __FUNCTION__, level); \ |