diff options
author | Timo Sirainen <cras@irssi.org> | 2000-08-11 22:07:42 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-08-11 22:07:42 +0000 |
commit | ccf12d2bfc9e0ab401ede4300f13a5c17e07e0bf (patch) | |
tree | 47d7d19327f6105d56558a632ede08f5a225deb8 /src/fe-common | |
parent | 82d272799c0c542bddb725c2ea73e85045bb22d7 (diff) | |
download | irssi-ccf12d2bfc9e0ab401ede4300f13a5c17e07e0bf.zip |
/LOG: Removed the -rotate option, it was pretty useless since adding
the % formats to file name already tells that the log should be
rotated.
Autologging supports log rotating now too, just add the wanted %
formats to /SET autolog_path
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@586 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/core/fe-log.c | 26 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.c | 2 |
2 files changed, 8 insertions, 20 deletions
diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c index 2c87d87f..4a563709 100644 --- a/src/fe-common/core/fe-log.c +++ b/src/fe-common/core/fe-log.c @@ -41,32 +41,25 @@ static int autolog_level; static int autoremove_tag; static const char *autolog_path; -/* SYNTAX: LOG OPEN [-noopen] [-autoopen] [-targets <targets>] [-window] - [-rotate hourly|daily|weekly|monthly] <fname> [<levels>] */ +/* SYNTAX: LOG OPEN [-noopen] [-autoopen] [-targets <targets>] + [-window] <fname> [<levels>] */ static void cmd_log_open(const char *data) { GHashTable *optlist; - char *targetarg, *rotatearg, *fname, *levels; + char *targetarg, *fname, *levels; void *free_arg; char window[MAX_INT_STRLEN]; LOG_REC *log; - int level, rotate; + int level; if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTIONS | PARAM_FLAG_GETREST, "log open", &optlist, &fname, &levels)) return; targetarg = g_hash_table_lookup(optlist, "targets"); - rotatearg = g_hash_table_lookup(optlist, "rotate"); if (*fname == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); - rotate = LOG_ROTATE_NEVER; - if (rotatearg != NULL) { - rotate = log_str2rotate(rotatearg); - if (rotate < 0) rotate = LOG_ROTATE_NEVER; - } - level = level2bits(levels); if (level == 0) level = MSGLEVEL_ALL; @@ -80,7 +73,6 @@ static void cmd_log_open(const char *data) if (log != NULL) { if (g_hash_table_lookup(optlist, "autoopen")) log->autoopen = TRUE; - log->rotate = rotate; log_update(log); if (log->handle == -1 && g_hash_table_lookup(optlist, "noopen") == NULL) { @@ -153,7 +145,7 @@ static void cmd_log_stop(const char *data) static void cmd_log_list(void) { GSList *tmp; - char *levelstr, *items, *rotate; + char *levelstr, *items; int index; printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_LOG_LIST_HEADER); @@ -163,15 +155,11 @@ static void cmd_log_list(void) levelstr = bits2level(rec->level); items = rec->items == NULL ? NULL : g_strjoinv(",", rec->items); - rotate = rec->rotate == 0 ? NULL : - g_strdup_printf(" -rotate %s", log_rotate2str(rec->rotate)); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_LOG_LIST, index, rec->fname, items != NULL ? items : "", - levelstr, rotate != NULL ? rotate : "", - rec->autoopen ? " -autoopen" : ""); + levelstr, rec->autoopen ? " -autoopen" : ""); - g_free_not_null(rotate); g_free_not_null(items); g_free(levelstr); } @@ -468,7 +456,7 @@ void fe_log_init(void) signal_add("awaylog show", (SIGNAL_FUNC) sig_awaylog_show); signal_add("setup changed", (SIGNAL_FUNC) read_settings); - command_set_options("log open", "noopen autoopen -targets window -rotate"); + command_set_options("log open", "noopen autoopen -targets window"); } void fe_log_deinit(void) diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index bb853dbf..6d79e2fb 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -80,7 +80,7 @@ FORMAT_REC fecommon_core_formats[] = { { "log_started", "Started logging to file %_$0", 1, { 0 } }, { "log_stopped", "Stopped logging to file %_$0", 1, { 0 } }, { "log_list_header", "Logs:", 0 }, - { "log_list", "$0 $1: $2 $3$4$5", 6, { 1, 0, 0, 0, 0, 0 } }, + { "log_list", "$0 $1: $2 $3$4", 5, { 1, 0, 0, 0, 0, 0 } }, { "log_list_footer", "", 0 }, { "windowlog_file", "Window LOGFILE set to $0", 1, { 0 } }, { "windowlog_file_logging", "Can't change window's logfile while log is on", 0 }, |