File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -319,11 +319,11 @@ defmodule Logger do
319
319
320
320
Each handler has the shape `{:handler, name, handler_module, config_map}`.
321
321
Once defined, a handler can be explicitly attached in your
322
- `c:Application.start/2` callback:
322
+ `c:Application.start/2` callback with `add_handlers/1` :
323
323
324
- :logger .add_handlers(:my_app)
324
+ Logger .add_handlers(:my_app)
325
325
326
- You can also developer your own handlers. Erlang handlers run in the same
326
+ You can also develop your own handlers. Handlers run in the same
327
327
process as the process logging the message/event. This gives developers
328
328
flexibility but they should avoid performing any long running action in
329
329
such handlers, as it may slow down the action being executed considerably.
@@ -725,6 +725,20 @@ defmodule Logger do
725
725
:ok
726
726
end
727
727
728
+ @ doc """
729
+ Adds the handlers configured in the `:logger` application parameter
730
+ of the given `app`.
731
+
732
+ This is used to register new handlers into the logging system.
733
+ See [the module documentation](#module-erlang-otp-handlers) for
734
+ more information.
735
+ """
736
+ @ doc since: "1.15.0"
737
+ @ spec add_handlers ( atom ( ) ) :: :ok | { :error , term }
738
+ def add_handlers ( app ) when is_atom ( app ) do
739
+ :logger . add_handlers ( app )
740
+ end
741
+
728
742
@ doc """
729
743
Adds a new backend.
730
744
"""
You can’t perform that action at this time.
0 commit comments