aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/supervisor_bridge.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-04-24 15:15:57 +0200
committerSiri Hansen <[email protected]>2018-04-26 14:37:31 +0200
commitc4504cbe3a474b0bb5dab00ae66d680d3d0e9ff1 (patch)
treef551c71f32d62285faac94d9d6b70482a3eeca29 /lib/stdlib/src/supervisor_bridge.erl
parent05e1548e5b452d4bfe3bc6837a1a1b51a6367f72 (diff)
downloadotp-c4504cbe3a474b0bb5dab00ae66d680d3d0e9ff1.tar.gz
otp-c4504cbe3a474b0bb5dab00ae66d680d3d0e9ff1.tar.bz2
otp-c4504cbe3a474b0bb5dab00ae66d680d3d0e9ff1.zip
Start using logger internally in kernel and stdlib
Diffstat (limited to 'lib/stdlib/src/supervisor_bridge.erl')
-rw-r--r--lib/stdlib/src/supervisor_bridge.erl27
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/stdlib/src/supervisor_bridge.erl b/lib/stdlib/src/supervisor_bridge.erl
index af1e046d30..39372935fa 100644
--- a/lib/stdlib/src/supervisor_bridge.erl
+++ b/lib/stdlib/src/supervisor_bridge.erl
@@ -21,6 +21,8 @@
-behaviour(gen_server).
+-include("logger.hrl").
+
%% External exports
-export([start_link/2, start_link/3]).
%% Internal exports
@@ -129,13 +131,22 @@ terminate_pid(Reason, #state{mod = Mod, child_state = ChildState}) ->
Mod:terminate(Reason, ChildState).
report_progress(Pid, Mod, StartArgs, SupName) ->
- Progress = [{supervisor, SupName},
- {started, [{pid, Pid}, {mfa, {Mod, init, [StartArgs]}}]}],
- error_logger:info_report(progress, Progress).
+ ?LOG_INFO(#{label=>{supervisor,progress},
+ report=>[{supervisor, SupName},
+ {started, [{pid, Pid},
+ {mfa, {Mod, init, [StartArgs]}}]}]},
+ #{domain=>[beam,erlang,otp,sasl],
+ report_cb=>fun logger:format_otp_report/1,
+ logger_formatter=>#{title=>"PROGRESS REPORT"},
+ error_logger=>#{tag=>info_report,type=>progress}}).
report_error(Error, Reason, #state{name = Name, pid = Pid, mod = Mod}) ->
- ErrorMsg = [{supervisor, Name},
- {errorContext, Error},
- {reason, Reason},
- {offender, [{pid, Pid}, {mod, Mod}]}],
- error_logger:error_report(supervisor_report, ErrorMsg).
+ ?LOG_ERROR(#{label=>{supervisor,error},
+ report=>[{supervisor, Name},
+ {errorContext, Error},
+ {reason, Reason},
+ {offender, [{pid, Pid}, {mod, Mod}]}]},
+ #{domain=>[beam,erlang,otp,sasl],
+ report_cb=>fun logger:format_otp_report/1,
+ logger_formatter=>#{title=>"SUPERVISOR REPORT"},
+ error_logger=>#{tag=>error_report,type=>supervisor_report}}).