diff options
author | Michael Vetter <jubalh@iodoru.org> | 2022-04-29 14:13:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 14:13:25 +0200 |
commit | e0bcaaf81fa93c9a258809bbe26859f0922654c7 (patch) | |
tree | 6ef1e74fe840ec87dd81ecfd04b7d9787f76f453 | |
parent | 4686a9ba2ce884396d9f1d27a8054ca26172f601 (diff) | |
parent | 4220a1832dd2afd3726b5d4aef4532a18f872380 (diff) | |
download | profani-tty-e0bcaaf81fa93c9a258809bbe26859f0922654c7.tar.gz |
Merge pull request #1700 from profanity-im/feat/change-chatlog
Use ISO8601 as date format in log files
-rw-r--r-- | src/log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/log.c b/src/log.c index 1f6eaa9d..296f20b5 100644 --- a/src/log.c +++ b/src/log.c @@ -196,7 +196,7 @@ log_msg(log_level_t level, const char* const area, const char* const msg) char* level_str = _log_string_from_level(level); - gchar* date_fmt = g_date_time_format(dt, "%d/%m/%Y %H:%M:%S"); + gchar* date_fmt = g_date_time_format_iso8601(dt); fprintf(logp, "%s: %s: %s: %s\n", date_fmt, area, level_str, msg); g_date_time_unref(dt); @@ -463,7 +463,7 @@ _chat_log_chat(const char* const login, const char* const other, const char* con g_date_time_ref(timestamp); } - gchar* date_fmt = g_date_time_format(timestamp, "%H:%M:%S"); + gchar* date_fmt = g_date_time_format_iso8601(timestamp); FILE* chatlogp = fopen(dated_log->filename, "a"); g_chmod(dated_log->filename, S_IRUSR | S_IWUSR); if (chatlogp) { @@ -576,7 +576,7 @@ _groupchat_log_chat(const gchar* const login, const gchar* const room, const gch GDateTime* dt_tmp = g_date_time_new_now_local(); - gchar* date_fmt = g_date_time_format(dt_tmp, "%H:%M:%S"); + gchar* date_fmt = g_date_time_format_iso8601(dt_tmp); FILE* grpchatlogp = fopen(dated_log->filename, "a"); g_chmod(dated_log->filename, S_IRUSR | S_IWUSR); |