# HG changeset patch # User David Demelier # Date 1564089000 0 # Node ID 6b65493d97cfe11051ef431ff9e5780e6c5eb039 # Parent 77004857505b1fb8f2a3341c2fac2a4edb62f5b9 plugin logger: rename path configuration to file, closes #1670 diff -r 77004857505b -r 6b65493d97cf MIGRATING.md --- 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 diff -r 77004857505b -r 6b65493d97cf plugins/logger/logger.7 --- 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}" diff -r 77004857505b -r 6b65493d97cf plugins/logger/logger.js --- 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) diff -r 77004857505b -r 6b65493d97cf tests/src/plugins/logger/main.cpp --- 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_);