diff options
author | Hans Bolinder <[email protected]> | 2017-05-17 16:16:58 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-05-18 15:36:34 +0200 |
commit | a99b0a2a570e7429b05f3ce424880744ee3a8814 (patch) | |
tree | c31d739d10110daff37488431c9f16c42ea05d4b /lib/kernel/src | |
parent | 86a74bfaefd570245740624d85659efa8821765b (diff) | |
download | otp-a99b0a2a570e7429b05f3ce424880744ee3a8814.tar.gz otp-a99b0a2a570e7429b05f3ce424880744ee3a8814.tar.bz2 otp-a99b0a2a570e7429b05f3ce424880744ee3a8814.zip |
kernel: Introcude error_logger:get_format_depth()
Diffstat (limited to 'lib/kernel/src')
-rw-r--r-- | lib/kernel/src/error_logger.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/kernel/src/error_logger.erl b/lib/kernel/src/error_logger.erl index 93a3f4f2e5..9bf8547745 100644 --- a/lib/kernel/src/error_logger.erl +++ b/lib/kernel/src/error_logger.erl @@ -31,7 +31,7 @@ handle_event/2, handle_call/2, handle_info/2, terminate/2]). --export([limit_term/1]). +-export([get_format_depth/0, limit_term/1]). -define(buffer_size, 10). @@ -524,12 +524,14 @@ string_p1(_) -> false. -spec limit_term(term()) -> term(). limit_term(Term) -> - case get_depth() of + case get_format_depth() of unlimited -> Term; D -> io_lib:limit_term(Term, D) end. -get_depth() -> +-spec get_format_depth() -> 'unlimited' | pos_integer(). + +get_format_depth() -> case application:get_env(kernel, error_logger_format_depth) of {ok, Depth} when is_integer(Depth) -> max(10, Depth); |