@@ -120,8 +120,9 @@ defmodule Logger do
120
120
The initial backends are loaded via the `:backends` configuration,
121
121
which must be set before the logger application is started. However,
122
122
backends can be added or removed dynamically via the `add_backend/2`,
123
- `remove_backend/1` and `configure_backend/2` functions. Note though
124
- that dynamically added backends are not restarded in case of crashes.
123
+ `remove_backend/1` and `configure_backend/2` functions, although such
124
+ backends are not persisted (i.e. if the Logger supervision tree crashes,
125
+ they are not re-added).
125
126
126
127
### Console backend
127
128
@@ -154,15 +155,15 @@ defmodule Logger do
154
155
writing a new backend is a matter of creating an event
155
156
handler, as described in the `GenEvent` module.
156
157
157
- From now on, we will be using event handler to refer to
158
- your custom backend, as we head into implementation details.
158
+ From now on, we will be using the term " event handler" to refer
159
+ to your custom backend, as we head into implementation details.
159
160
160
- The `add_backend/1` function is used to start a new
161
- backend, which installs the given event handler to the
162
- Logger event manager. This event handler is automatically
163
- supervised by Logger.
161
+ Once Logger starts, it installs all event handlers under
162
+ the `:backends` configuration into Logger event manager.
163
+ The event manager and all added event handlers are
164
+ automatically supervised by Logger.
164
165
165
- Once added , the handler should be able to handle events
166
+ Once initialized , the handler should be able to handle events
166
167
in the following format:
167
168
168
169
{level, group_leader,
@@ -178,15 +179,15 @@ defmodule Logger do
178
179
the group leader is in a different node than the one
179
180
the handler is installed.
180
181
181
- Furthermore, backends can be configured via the `configure_backend/2`
182
- function which requires event handlers to handle calls of
183
- the following format:
182
+ Furthermore, backends can be configured via the
183
+ `configure_backend/2` function which requires event handlers
184
+ to handle calls of the following format:
184
185
185
186
{:configure, options}
186
187
187
188
where options is a keyword list. The result of the call is
188
- the result returned by `configure_backend/2`. You may simply
189
- return `:ok` if you don't perform any kind of validation .
189
+ the result returned by `configure_backend/2`. The recommended
190
+ return value for successful configuration is `:ok` .
190
191
191
192
It is recommended that backends support at least the following
192
193
configuration values:
0 commit comments