Current section
Files
Jump to
Current section
Files
src/olive@logging.erl
-module(olive@logging).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([configure_logs/1, notice/1, error/1]).
-export_type([log_level/0, log_level_filter/0]).
-type log_level() :: emergency | error | notice.
-type log_level_filter() :: all_logs | errors_only | no_logs.
-file("src/olive/logging.gleam", 13).
-spec configure_logs(log_level_filter()) -> nil.
configure_logs(Level) ->
case Level of
all_logs ->
olive_ffi:configure_logs(notice);
errors_only ->
olive_ffi:configure_logs(error);
no_logs ->
olive_ffi:configure_logs(emergency)
end.
-file("src/olive/logging.gleam", 25).
-spec notice(binary()) -> nil.
notice(Msg) ->
olive_ffi:log(notice, Msg).
-file("src/olive/logging.gleam", 29).
-spec error(binary()) -> nil.
error(Msg) ->
olive_ffi:log(error, Msg).