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:16:35 -0500 |
commit | 65029e017f4fdbd88c36fa507317748fba5b5008 (patch) | |
tree | 13025e00d2272a8ffe549a6e567028b69fc05b1a /server/util/util.h | |
parent | a852c21ffdc52ca39402fe9876f3c2fa8cffde28 (diff) | |
download | sssd_unused-65029e017f4fdbd88c36fa507317748fba5b5008.tar.gz sssd_unused-65029e017f4fdbd88c36fa507317748fba5b5008.tar.xz sssd_unused-65029e017f4fdbd88c36fa507317748fba5b5008.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); \ |