From ec658f3f86d00f8d7f282ee6124994fbc68f52e5 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sat, 3 Aug 2024 04:03:58 -0400 Subject: [PATCH] Don't fail with an 'undefined' log level when an unknown CLI argument is provided. References #44. --- src/cuttlefish_escript.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cuttlefish_escript.erl b/src/cuttlefish_escript.erl index 6c12ed3..9a01a56 100644 --- a/src/cuttlefish_escript.erl +++ b/src/cuttlefish_escript.erl @@ -77,7 +77,7 @@ parse_and_command(Args) -> main(Args) -> {Command, ParsedArgs, Extra} = parse_and_command(Args), - SuggestedLogLevel = list_to_atom(proplists:get_value(log_level, ParsedArgs)), + SuggestedLogLevel = list_to_atom(proplists:get_value(log_level, ParsedArgs, "notice")), LogLevel = case lists:member(SuggestedLogLevel, [debug, info, notice, warning, error, critical, alert, emergency]) of true -> SuggestedLogLevel; _ -> notice