Refactor: fold colorize_/3 into colorize/4.
Fold a local one-line leaf function with exactly one call-site into its caller.
This commit is contained in:
parent
02ab88513f
commit
6079300634
1 changed files with 1 additions and 5 deletions
|
@ -218,14 +218,10 @@ format(Log) ->
|
||||||
|
|
||||||
-spec colorize(t(), color(), boolean(), string()) -> string().
|
-spec colorize(t(), color(), boolean(), string()) -> string().
|
||||||
colorize(#state_t{caller=command_line}, Color, false, Msg) when is_integer(Color) ->
|
colorize(#state_t{caller=command_line}, Color, false, Msg) when is_integer(Color) ->
|
||||||
colorize_(Color, 0, Msg);
|
lists:flatten(io_lib:format("\033[~B;~Bm~s~s\033[0m", [0, Color, ?PREFIX, Msg]));
|
||||||
colorize(_LogState, _Color, _Bold, Msg) ->
|
colorize(_LogState, _Color, _Bold, Msg) ->
|
||||||
Msg.
|
Msg.
|
||||||
|
|
||||||
-spec colorize_(color(), integer(), string()) -> string().
|
|
||||||
colorize_(Color, Bold, Msg) when is_integer(Color), is_integer(Bold)->
|
|
||||||
lists:flatten(io_lib:format("\033[~B;~Bm~s~s\033[0m", [Bold, Color, ?PREFIX, Msg])).
|
|
||||||
|
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
%%% Test Functions
|
%%% Test Functions
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue