diff plugins/logger/logger.md @ 144:5ed0c78a6785

Plugin logger: use new format section, #410 Also fix various issues: - Parameter file is incorrect, - Formats were not loaded.
author David Demelier <markand@malikania.fr>
date Thu, 19 May 2016 22:03:53 +0200
parents 131551c901ae
children c143682678b9
line wrap: on
line diff
--- a/plugins/logger/logger.md	Thu May 19 21:17:50 2016 +0200
+++ b/plugins/logger/logger.md	Thu May 19 22:03:53 2016 +0200
@@ -32,11 +32,28 @@
 
 ## Configuration
 
-The plugin **logger** can be configured to format logs and to use different log path.
-
 The following options are available under the `[plugin.logger]` section:
 
-  - **file**: (string) the path to the file where to store logs,
+  - **path**: (string) the path to the file where to store logs,
+
+**Deprecated in irccd 2.1.0:**
+
+  - **format-cmode**: Use `[format.logger] cmode` instead,
+  - **format-cnotice**: Use `[format.logger] cnotice` instead,
+  - **format-join**: Use `[format.logger] join` instead,
+  - **format-kick**: Use `[format.logger] kick` instead,
+  - **format-me**: Use `[format.logger] me` instead,
+  - **format-message**: Use `[format.logger] message` instead,
+  - **format-mode**: Use `[format.logger] mode` instead,
+  - **format-notice**: Use `[format.logger] notice` instead,
+  - **format-part**: Use `[format.logger] part` instead,
+  - **format-query**: Use `[format.logger] query` instead,
+  - **format-topic**: Use `[format.logger] topic` instead,
+
+## Formats
+
+The **logger** plugin supports the following formats in `[format.logger]` section:
+
   - **cmode**: (string) format for channel mode change,
   - **cnotice**: (string) format for channel notices,
   - **join**: (string) format when someone joins a channel,
@@ -53,20 +70,20 @@
 
 The following keywords are supported:
 
-| Format                  | Keywords                          | Notes                           |
-|-------------------------|-----------------------------------|---------------------------------|
-| (any)                   | nickname, origin, server, source  | source is the channel or nick   |
-| **format-cmode**        | arg, channel, mode,               | the mode and its arguments      |
-| **format-cnotice**      | channel, message                  | the message notice              |
-| **format-join**         | channel                           |                                 |
-| **format-kick**         | channel, reason, target           |                                 |
-| **format-me**           | channel, message                  | message is the emote action     |
-| **format-message**      | channel, message                  |                                 |
-| **format-mode**         | arg, mode                         | the mode and its arguments      |
-| **format-notice**       | message                           | the notice message              |
-| **format-part**         | channel, reason                   |                                 |
-| **format-query**        | message                           |                                 |
-| **format-topic**        | channel, topic                    |                                 |
+| Format      | Keywords                          | Notes                           |
+|-------------|-----------------------------------|---------------------------------|
+| (any)       | nickname, origin, server, source  | source is the channel or nick   |
+| **cmode**   | arg, channel, mode,               | the mode and its arguments      |
+| **cnotice** | channel, message                  | the message notice              |
+| **join**    | channel                           |                                 |
+| **kick**    | channel, reason, target           |                                 |
+| **me**      | channel, message                  | message is the emote action     |
+| **message** | channel, message                  |                                 |
+| **mode**    | arg, mode                         | the mode and its arguments      |
+| **notice**  | message                           | the notice message              |
+| **part**    | channel, reason                   |                                 |
+| **query**   | message                           |                                 |
+| **topic**   | channel, topic                    |                                 |
 
 The **source** keyword is specially designed to use a generic path for the path parameter.
 
@@ -77,8 +94,10 @@
  <div class="panel-body">
 ````ini
 [plugin.logger]
-file = "/var/log/irccd/#{server}/%y/%m/%d/#{source}.txt"
-format-join = "user #{nickname} joined #{channel}"
+path = "/var/log/irccd/#{server}/%y/%m/%d/#{source}.txt"
+
+[format.logger]
+join = "user #{nickname} joined #{channel}"
 ````
  </div>
 </div>