summaryrefslogtreecommitdiff
path: root/src/plugins/logger
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-03-05 18:32:46 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-03-05 18:32:46 +0100
commit573b4d9dec340c214578701d6aeb67415f289584 (patch)
treea2f73efed7cfe19cd3a61e29e2b9763afa8d5a73 /src/plugins/logger
parent4d2925ef1c3dd5df288be55557358b60cbb0926e (diff)
downloadweechat-573b4d9dec340c214578701d6aeb67415f289584.zip
New default value for logger time format (prevents problem with backlog when locale is changed)
Diffstat (limited to 'src/plugins/logger')
-rw-r--r--src/plugins/logger/logger.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index 0bba28722..3f3f467f7 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -53,6 +53,12 @@ struct t_weechat_plugin *weechat_logger_plugin = NULL;
#define LOGGER_OPTION_INFO_LINES "info_lines"
#define LOGGER_OPTION_BACKLOG "backlog"
+#define LOGGER_DEFAULT_OPTION_PATH "%h/logs/"
+#define LOGGER_DEFAULT_OPTION_NAME_LOWER_CASE "on"
+#define LOGGER_DEFAULT_OPTION_TIME_FORMAT "%Y-%m-%d %H:%M:%S"
+#define LOGGER_DEFAULT_OPTION_INFO_LINES "off"
+#define LOGGER_DEFAULT_OPTION_BACKLOG "20"
+
char *logger_option_path = NULL;
int logger_option_name_lower_case;
char *logger_option_time_format = NULL;
@@ -75,14 +81,16 @@ logger_config_read ()
logger_option_path = weechat_config_get_plugin (LOGGER_OPTION_PATH);
if (!logger_option_path)
{
- weechat_config_set_plugin (LOGGER_OPTION_PATH, "%h/logs/");
+ weechat_config_set_plugin (LOGGER_OPTION_PATH,
+ LOGGER_DEFAULT_OPTION_PATH);
logger_option_path = weechat_config_get_plugin ("path");
}
string = weechat_config_get_plugin (LOGGER_OPTION_NAME_LOWER_CASE);
if (!string)
{
- weechat_config_set_plugin (LOGGER_OPTION_NAME_LOWER_CASE, "on");
+ weechat_config_set_plugin (LOGGER_OPTION_NAME_LOWER_CASE,
+ LOGGER_DEFAULT_OPTION_NAME_LOWER_CASE);
string = weechat_config_get_plugin (LOGGER_OPTION_NAME_LOWER_CASE);
}
if (string && (weechat_config_string_to_boolean (string) > 0))
@@ -94,14 +102,15 @@ logger_config_read ()
if (!logger_option_time_format)
{
weechat_config_set_plugin (LOGGER_OPTION_TIME_FORMAT,
- "%Y %b %d %H:%M:%S");
+ LOGGER_DEFAULT_OPTION_TIME_FORMAT);
logger_option_time_format = weechat_config_get_plugin (LOGGER_OPTION_TIME_FORMAT);
}
string = weechat_config_get_plugin (LOGGER_OPTION_INFO_LINES);
if (!string)
{
- weechat_config_set_plugin (LOGGER_OPTION_INFO_LINES, "off");
+ weechat_config_set_plugin (LOGGER_OPTION_INFO_LINES,
+ LOGGER_DEFAULT_OPTION_INFO_LINES);
string = weechat_config_get_plugin (LOGGER_OPTION_INFO_LINES);
}
if (string && (weechat_config_string_to_boolean (string) > 0))
@@ -112,7 +121,8 @@ logger_config_read ()
string = weechat_config_get_plugin (LOGGER_OPTION_BACKLOG);
if (!string)
{
- weechat_config_set_plugin (LOGGER_OPTION_BACKLOG, "20");
+ weechat_config_set_plugin (LOGGER_OPTION_BACKLOG,
+ LOGGER_DEFAULT_OPTION_BACKLOG);
string = weechat_config_get_plugin (LOGGER_OPTION_BACKLOG);
}
logger_option_backlog = 20;