mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-20 13:16:36 +02:00
Add support for custom timestamps in chat and logs.
Internal representations of the time_format setting are replaced by timestamp format strings. time_format is only used in the setup. Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
@ -134,7 +134,7 @@ void write_to_log(const char *msg, const char *name, struct chatlog *log, bool e
|
||||
else
|
||||
snprintf(name_frmt, sizeof(name_frmt), "%s:", name);
|
||||
|
||||
const char *t = user_settings->time == TIME_12 ? "%Y/%m/%d [%I:%M:%S %p]" : "%Y/%m/%d [%H:%M:%S]";
|
||||
const char *t = user_settings->log_timestamp_format;
|
||||
char s[MAX_STR_SIZE];
|
||||
strftime(s, MAX_STR_SIZE, t, get_time());
|
||||
fprintf(log->file, "%s %s %s\n", s, name_frmt, msg);
|
||||
|
Reference in New Issue
Block a user