diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-11-08 07:54:33 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-11-08 07:54:33 +0000 |
commit | c20ce83d20526e24601c6c8acabc7a61ab3c3a78 (patch) | |
tree | a8e1b79498ef7cd410176680d9bfb585270aa576 /src/common/log.c | |
parent | b5a7d8e99e372378cb47069a3d2ad0bf65ccc530 (diff) | |
download | weechat-c20ce83d20526e24601c6c8acabc7a61ab3c3a78.zip |
Added charset plugin (WeeChat is now full UTF-8 for internal data storage), fixed compilation problems with FreeBSD, fixed status bar display bug
Diffstat (limited to 'src/common/log.c')
-rw-r--r-- | src/common/log.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/common/log.c b/src/common/log.c index 5788f2717..d76e91104 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -38,6 +38,7 @@ #include "weechat.h" #include "log.h" +#include "util.h" char *weechat_log_filename = NULL; /* log name (~/.weechat/weechat.log) */ @@ -99,11 +100,11 @@ weechat_log_init () { if (!weechat_log_open (NULL, "w")) { - fprintf (stderr, - _("%s unable to create/append to log file\n" - "If another WeeChat process is using this file, try to run WeeChat\n" - "with another home using \"--dir\" command line option.\n"), - WEECHAT_ERROR); + weechat_iconv_fprintf (stderr, + _("%s unable to create/append to log file\n" + "If another WeeChat process is using this file, try to run WeeChat\n" + "with another home using \"--dir\" command line option.\n"), + WEECHAT_ERROR); exit (1); } } @@ -142,12 +143,13 @@ weechat_log_printf (char *message, ...) seconds = time (NULL); date_tmp = localtime (&seconds); if (date_tmp) - fprintf (weechat_log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s", - date_tmp->tm_year + 1900, date_tmp->tm_mon + 1, date_tmp->tm_mday, - date_tmp->tm_hour, date_tmp->tm_min, date_tmp->tm_sec, - buffer); + weechat_iconv_fprintf (weechat_log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s", + date_tmp->tm_year + 1900, date_tmp->tm_mon + 1, date_tmp->tm_mday, + date_tmp->tm_hour, date_tmp->tm_min, date_tmp->tm_sec, + buffer); else - fprintf (weechat_log_file, "%s", buffer); + weechat_iconv_fprintf (weechat_log_file, "%s", buffer); + fflush (weechat_log_file); } @@ -212,8 +214,8 @@ weechat_log_crash_rename () getpid()); if (rename (old_name, new_name) == 0) { - fprintf (stderr, "*** Full crash dump was saved to %s file.\n", - new_name); + weechat_iconv_fprintf (stderr, "*** Full crash dump was saved to %s file.\n", + new_name); weechat_log_open (new_name, "a"); free (old_name); free (new_name); |