diff options
author | Timo Sirainen <cras@irssi.org> | 2002-12-28 17:54:13 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-12-28 17:54:13 +0000 |
commit | bd6fe052bce57849a7a850c0c5bee0ad896b9460 (patch) | |
tree | 95f3cb743874913a6dc1ff1314264b88989a4b60 /src/core/log-away.c | |
parent | 9c18cb00e7d096e46f5853f802724da4c59c2857 (diff) | |
download | irssi-bd6fe052bce57849a7a850c0c5bee0ad896b9460.zip |
Added time, size and level setting types. Breaks some settings - I'll add
automatic converter to these settings later. Meanwhile you CVS users can
fix your config files yourself :)
Time settings allow using "days", "hours", "minutes", "seconds" and
"milliseconds" or several of their abbreviations. For example "5d 4h
5msecs".
Size settings allow using "gbytes", "mbytes", "kbytes" and "bytes" or their
abbrevations. For example "5MB".
Level settings are currently handled pretty much the way they were before.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3080 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/log-away.c')
-rw-r--r-- | src/core/log-away.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/log-away.c b/src/core/log-away.c index 724e4b4a..586d17d4 100644 --- a/src/core/log-away.c +++ b/src/core/log-away.c @@ -38,16 +38,13 @@ static void sig_log_written(LOG_REC *log) static void awaylog_open(void) { - const char *fname, *levelstr; + const char *fname; LOG_REC *log; int level; fname = settings_get_str("awaylog_file"); - levelstr = settings_get_str("awaylog_level"); - if (*fname == '\0' || *levelstr == '\0') return; - - level = level2bits(levelstr); - if (level == 0) return; + level = settings_get_level("awaylog_level"); + if (*fname == '\0' || level == 0) return; log = log_find(fname); if (log != NULL && log->handle != -1) @@ -106,7 +103,7 @@ void log_away_init(void) away_msgs = 0; settings_add_str("log", "awaylog_file", IRSSI_DIR_SHORT"/away.log"); - settings_add_str("log", "awaylog_level", "msgs hilight"); + settings_add_level("log", "awaylog_level", "msgs hilight"); signal_add("log written", (SIGNAL_FUNC) sig_log_written); signal_add("away mode changed", (SIGNAL_FUNC) sig_away_changed); |