Mercurial > irccd
changeset 862:6b65493d97cf
plugin logger: rename path configuration to file, closes #1670
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 25 Jul 2019 21:10:00 +0000 |
parents | 77004857505b |
children | 659be263703e |
files | MIGRATING.md plugins/logger/logger.7 plugins/logger/logger.js tests/src/plugins/logger/main.cpp |
diffstat | 4 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/MIGRATING.md Thu Jul 25 21:00:00 2019 +0000 +++ b/MIGRATING.md Thu Jul 25 21:10:00 2019 +0000 @@ -39,6 +39,7 @@ - The keyword `source` has been removed and replaced by `channel`, - The keyword `origin` has been added, - Formats `cnotice`, `cmode`, `query` have been removed. +- The option `path` has been renamed to `file`. ## Network API
--- a/plugins/logger/logger.7 Thu Jul 25 21:00:00 2019 +0000 +++ b/plugins/logger/logger.7 Thu Jul 25 21:10:00 2019 +0000 @@ -65,7 +65,7 @@ .Va [plugin.logger] section: .Bl -tag -width 14n -offset Ds -.It Va path No (string) +.It Va file No (string) The path to the file where to store logs. Keywords: .Em channel , server , (date) . .El @@ -109,7 +109,7 @@ Example of configuration file: .Bd -literal [plugin.logger] -path = "/var/log/irccd/#{server}/%y/%m/%d/#{channel}.txt" +file = "/var/log/irccd/#{server}/%y/%m/%d/#{channel}.txt" [templates.logger] join = "user #{nickname} joined #{channel}"
--- a/plugins/logger/logger.js Thu Jul 25 21:00:00 2019 +0000 +++ b/plugins/logger/logger.js Thu Jul 25 21:10:00 2019 +0000 @@ -64,7 +64,7 @@ function write(fmt, args) { - var path = Util.format(Plugin.config["path"], args); + var path = Util.format(Plugin.config["file"], args); var directory = File.dirname(path); // Try to create the directory. @@ -83,8 +83,8 @@ function onLoad() { - if (Plugin.config["path"] === undefined) - throw new Error("Missing 'path' option"); + if (Plugin.config["file"] === undefined) + throw new Error("Missing 'file' option"); } function onInvite(server, origin, channel)
--- a/tests/src/plugins/logger/main.cpp Thu Jul 25 21:00:00 2019 +0000 +++ b/tests/src/plugins/logger/main.cpp Thu Jul 25 21:10:00 2019 +0000 @@ -65,8 +65,8 @@ void load(plugin::map config = {}) { - if (config.count("path") == 0) - config.emplace("path", CMAKE_CURRENT_BINARY_DIR "/log.txt"); + if (config.count("file") == 0) + config.emplace("file", CMAKE_CURRENT_BINARY_DIR "/log.txt"); plugin_->set_options(config); plugin_->handle_load(bot_);