aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-04-26 15:13:45 +0200
committerSiri Hansen <[email protected]>2018-04-26 15:13:45 +0200
commit87fa7eab402cd93796a66ab648eab75909e17254 (patch)
treeb4edcd70437bbd30da74fb7e50c37674331d60b1 /lib/kernel/src/logger.erl
parent992b57ad0a52f7a3ba945cbfaea53ce3ae3c3f5d (diff)
downloadotp-87fa7eab402cd93796a66ab648eab75909e17254.tar.gz
otp-87fa7eab402cd93796a66ab648eab75909e17254.tar.bz2
otp-87fa7eab402cd93796a66ab648eab75909e17254.zip
Catch badarg in logger:get_format_depth/0
This env var lookup may fail during termination, when application_controller process has terminated before logger.
Diffstat (limited to 'lib/kernel/src/logger.erl')
-rw-r--r--lib/kernel/src/logger.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl
index 7606912da4..943ef8c2d1 100644
--- a/lib/kernel/src/logger.erl
+++ b/lib/kernel/src/logger.erl
@@ -621,9 +621,13 @@ get_type_config(Type) ->
-spec limit_term(term()) -> term().
limit_term(Term) ->
- case get_format_depth() of
+ try get_format_depth() of
unlimited -> Term;
D -> io_lib:limit_term(Term, D)
+ catch error:badarg ->
+ %% This could happen during system termination, after
+ %% application_controller process is dead.
+ unlimited
end.
-spec get_format_depth() -> 'unlimited' | pos_integer().