sync with 0.8.1cvs8
authorPaul Mangan <paul@claws-mail.org>
Thu, 1 Aug 2002 09:10:24 +0000 (09:10 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 1 Aug 2002 09:10:24 +0000 (09:10 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/utils.c

index 89ed885ad2ca4d78030a9f9ab7ab935d2daad656..3df766d60e3f8cada4de91dce181ab65a46b103d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@
 
        * src/compose.c: compose_wrap_line_all(): fixed character buffer
          initialization.
+       * src/utils.c:
+         log_print()
+         log_message()
+         log_warning()
+         log_error(): add time stamp to log messages.
 
 2002-07-31
 
index 35cd75e9021ab6e6423e48ea303204786a0426c7..86b700c40b24b871b06f704d5f1cee256b69a3f0 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-01 [paul]      0.8.1claws8
+
+       * sync with 0.8.1cvs8
+               see ChangeLog entry 2002-08-01
+
 2002-08-01 [paul]      0.8.1claws7
 
        * sync with 0.8.1cvs7
index bbb56ff2d1c72c8e40a7c4ae963e163fe6acf33a..fcda095478430e6401dad9747cf4e98f49a4dd7a 100644 (file)
@@ -2,6 +2,11 @@
 
        * src/compose.c: compose_wrap_line_all(): Ê¸»ú¥Ð¥Ã¥Õ¥¡¤Î½é´ü²½¤ò
          ½¤Àµ¡£
+       * src/utils.c:
+         log_print()
+         log_message()
+         log_warning()
+         log_error(): ¥í¥°¥á¥Ã¥»¡¼¥¸¤Ë¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÄɲá£
 
 2002-07-31
 
index e5010f856766376a543f0b48b304e0147424f4d3..060b7b967d0b1f7a4dfc68777652148294e7a3fd 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws7
+EXTRA_VERSION=claws8
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 498faa80cdf0090c167b2c3aa6421183341beed8..c9fc6bf4cc2a3c2e58de58a151e41385246518a1 100644 (file)
@@ -2542,66 +2542,74 @@ void debug_print_real(const gchar *format, ...)
        fputs(buf, stdout);
 }
 
+#define TIME_LEN       11
+
 void log_print(const gchar *format, ...)
 {
        va_list args;
-       gchar buf[BUFFSIZE];
-       gchar *logbuf;
-       gchar timestr[6];
+       gchar buf[BUFFSIZE + TIME_LEN];
        time_t t;
 
+       time(&t);
+       strftime(buf, TIME_LEN + 1, "[%H:%M:%S] ", localtime(&t));
+
        va_start(args, format);
-       g_vsnprintf(buf, sizeof(buf), format, args);
+       g_vsnprintf(buf + TIME_LEN, BUFFSIZE, format, args);
        va_end(args);
-       
-       time(&t);
-       strftime(timestr, 6, "%H:%M", localtime(&t));
-       logbuf = g_strdup_printf("[%s] %s", timestr, buf);
 
-       if (debug_mode) fputs(logbuf, stdout);
-       log_window_append(logbuf, LOG_NORMAL);
+       if (debug_mode) fputs(buf, stdout);
+       log_window_append(buf, LOG_NORMAL);
        if (log_fp) {
-               fputs(logbuf, log_fp);
+               fputs(buf, log_fp);
                fflush(log_fp);
        }
        if (log_verbosity_count)
-               statusbar_puts_all(buf);
-       g_free(logbuf);
+               statusbar_puts_all(buf + TIME_LEN);
 }
 
 void log_message(const gchar *format, ...)
 {
        va_list args;
-       gchar buf[BUFFSIZE];
+       gchar buf[BUFFSIZE + TIME_LEN];
+       time_t t;
+
+       time(&t);
+       strftime(buf, TIME_LEN + 1, "[%H:%M:%S] ", localtime(&t));
 
        va_start(args, format);
-       g_vsnprintf(buf, sizeof(buf), format, args);
+       g_vsnprintf(buf + TIME_LEN, BUFFSIZE, format, args);
        va_end(args);
 
-       if (debug_mode) g_message("%s", buf);
-       log_window_append(buf, LOG_MSG);
+       if (debug_mode) g_message("%s", buf + TIME_LEN);
+       log_window_append(buf + TIME_LEN, LOG_MSG);
        if (log_fp) {
-               fputs("message: ", log_fp);
-               fputs(buf, log_fp);
+               fwrite(buf, TIME_LEN, 1, log_fp);
+               fputs("* message: ", log_fp);
+               fputs(buf + TIME_LEN, log_fp);
                fflush(log_fp);
        }
-       statusbar_puts_all(buf);
+       statusbar_puts_all(buf + TIME_LEN);
 }
 
 void log_warning(const gchar *format, ...)
 {
        va_list args;
-       gchar buf[BUFFSIZE];
+       gchar buf[BUFFSIZE + TIME_LEN];
+       time_t t;
+
+       time(&t);
+       strftime(buf, TIME_LEN + 1, "[%H:%M:%S] ", localtime(&t));
 
        va_start(args, format);
-       g_vsnprintf(buf, sizeof(buf), format, args);
+       g_vsnprintf(buf + TIME_LEN, BUFFSIZE, format, args);
        va_end(args);
 
        g_warning("%s", buf);
-       log_window_append(buf, LOG_WARN);
+       log_window_append(buf + TIME_LEN, LOG_WARN);
        if (log_fp) {
-               fputs("*** warning: ", log_fp);
-               fputs(buf, log_fp);
+               fwrite(buf, TIME_LEN, 1, log_fp);
+               fputs("** warning: ", log_fp);
+               fputs(buf + TIME_LEN, log_fp);
                fflush(log_fp);
        }
 }
@@ -2609,17 +2617,22 @@ void log_warning(const gchar *format, ...)
 void log_error(const gchar *format, ...)
 {
        va_list args;
-       gchar buf[BUFFSIZE];
+       gchar buf[BUFFSIZE + TIME_LEN];
+       time_t t;
+
+       time(&t);
+       strftime(buf, TIME_LEN + 1, "[%H:%M:%S] ", localtime(&t));
 
        va_start(args, format);
-       g_vsnprintf(buf, sizeof(buf), format, args);
+       g_vsnprintf(buf + TIME_LEN, BUFFSIZE, format, args);
        va_end(args);
 
        g_warning("%s", buf);
-       log_window_append(buf, LOG_ERROR);
+       log_window_append(buf + TIME_LEN, LOG_ERROR);
        if (log_fp) {
+               fwrite(buf, TIME_LEN, 1, log_fp);
                fputs("*** error: ", log_fp);
-               fputs(buf, log_fp);
+               fputs(buf + TIME_LEN, log_fp);
                fflush(log_fp);
        }
 }