[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-747-gbc6d725
ticho at claws-mail.org
ticho at claws-mail.org
Tue May 14 16:18:32 CEST 2019
The branch, gtk3 has been updated
via bc6d725103886268f168bbdb343dcdfae40470da (commit)
via db96dbfbc9c54a9e1298f6dea774168c7da8d2cc (commit)
from e171555264ae7d84ba7073cc29a0fee9a3149bb6 (commit)
Summary of changes:
src/common/log.c | 14 +++++++-------
src/common/log.h | 3 ++-
2 files changed, 9 insertions(+), 8 deletions(-)
- Log -----------------------------------------------------------------
commit bc6d725103886268f168bbdb343dcdfae40470da
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Tue May 14 16:15:10 2019 +0200
Move log timestamp format string to a separate macro in log.h
diff --git a/src/common/log.c b/src/common/log.c
index 1a399b8..5540a89 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -199,7 +199,7 @@ void log_print(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, LOG_TIME_FORMAT, localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -230,7 +230,7 @@ void log_message(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, LOG_TIME_FORMAT, localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -264,7 +264,7 @@ void log_warning(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, LOG_TIME_FORMAT, localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -298,7 +298,7 @@ void log_error(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, LOG_TIME_FORMAT, localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -332,7 +332,7 @@ void log_status_ok(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, LOG_TIME_FORMAT, localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -366,7 +366,7 @@ void log_status_nok(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, LOG_TIME_FORMAT, localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -400,7 +400,7 @@ void log_status_skip(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, LOG_TIME_FORMAT, localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
diff --git a/src/common/log.h b/src/common/log.h
index f00e837..64bd91a 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -29,6 +29,7 @@
#define LOG_APPEND_TEXT_HOOKLIST "log_append_text"
#define DEBUG_FILTERING_APPEND_TEXT_HOOKLIST "debug_append_text"
+#define LOG_TIME_FORMAT "[%Y-%m-%d %H:%M:%S] "
#define LOG_TIME_LEN 22
typedef enum
commit db96dbfbc9c54a9e1298f6dea774168c7da8d2cc
Author: wwp <subscript at free.fr>
Date: Tue May 14 10:09:12 2019 +0200
Add date (ISO format) to log timestamps.
diff --git a/src/common/log.c b/src/common/log.c
index 344eb97..1a399b8 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -199,7 +199,7 @@ void log_print(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -230,7 +230,7 @@ void log_message(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -264,7 +264,7 @@ void log_warning(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -298,7 +298,7 @@ void log_error(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -332,7 +332,7 @@ void log_status_ok(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -366,7 +366,7 @@ void log_status_nok(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
@@ -400,7 +400,7 @@ void log_status_skip(LogInstance instance, const gchar *format, ...)
struct tm buft;
time(&t);
- strftime(buf, LOG_TIME_LEN + 1, "[%H:%M:%S] ", localtime_r(&t, &buft));
+ strftime(buf, LOG_TIME_LEN + 1, "[%Y-%m-%d %H:%M:%S] ", localtime_r(&t, &buft));
va_start(args, format);
g_vsnprintf(buf + LOG_TIME_LEN, BUFFSIZE, format, args);
diff --git a/src/common/log.h b/src/common/log.h
index c48343b..f00e837 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -29,7 +29,7 @@
#define LOG_APPEND_TEXT_HOOKLIST "log_append_text"
#define DEBUG_FILTERING_APPEND_TEXT_HOOKLIST "debug_append_text"
-#define LOG_TIME_LEN 11
+#define LOG_TIME_LEN 22
typedef enum
{
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list