# HG changeset patch # User David Demelier # Date 1478003979 -3600 # Node ID 50dcadcf50704c9e4c70f025b3db0d5a321c0b89 # Parent c234b8db1816f5c7e83880f1a9bbe9719611a0a3 Plugin logger: various error, closes #505, closes #507 diff -r c234b8db1816 -r 50dcadcf5070 plugins/logger/logger.js --- a/plugins/logger/logger.js Tue Nov 01 13:10:20 2016 +0100 +++ b/plugins/logger/logger.js Tue Nov 01 13:39:39 2016 +0100 @@ -83,7 +83,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 */ @@ -95,15 +95,22 @@ Logger.debug("opening: " + path); var str = Util.format(formats[fmt], args); - var file = new File(path, "wa"); + var file = new File(path, "a"); file.write(str + "\n"); } function onLoad() { - if (Plugin.config["path"] === undefined) - throw new Error("Missing 'path' option"); + if (Plugin.config["file"] === undefined) + throw new Error("Missing 'file' option"); + + loadFormats(); +} + +function onReload() +{ + loadFormats(); } function onChannelMode(server, origin, channel, mode, arg) diff -r c234b8db1816 -r 50dcadcf5070 plugins/logger/logger.md --- a/plugins/logger/logger.md Tue Nov 01 13:10:20 2016 +0100 +++ b/plugins/logger/logger.md Tue Nov 01 13:39:39 2016 +0100 @@ -37,17 +37,17 @@ The following options are available under the `[plugin.logger]` section: - **file**: (string) the path to the file where to store logs, - - **cmode**: (string) format for channel mode change, - - **cnotice**: (string) format for channel notices, - - **join**: (string) format when someone joins a channel, - - **kick**: (string) format when someone has been kicked, - - **me**: (string) format for emote actions, - - **message**: (string) format for channel messages, - - **mode**: (string) format for user mode change, - - **notice**: (string) format on private notices, - - **part**: (string) format when someone leaves a channel, - - **query**: (string) format on private messages, - - **topic**: (string) format when a topic is changed. + - **format-cmode**: (string) format for channel mode change, + - **format-cnotice**: (string) format for channel notices, + - **format-join**: (string) format when someone joins a channel, + - **format-kick**: (string) format when someone has been kicked, + - **format-me**: (string) format for emote actions, + - **format-message**: (string) format for channel messages, + - **format-mode**: (string) format for user mode change, + - **format-notice**: (string) format on private notices, + - **format-part**: (string) format when someone leaves a channel, + - **format-query**: (string) format on private messages, + - **format-topic**: (string) format when a topic is changed. ### Keywords supported