Allow for run-time changes to log_level and forced_logs
Will not lead to immediate run time changes in SST or CDB logs. These log settings will only change once the new files are re-written. To completely change the log level - a restart of the store is necessary with new startup options.
This commit is contained in:
parent
6677f2e5c6
commit
672cfd4fcd
7 changed files with 239 additions and 16 deletions
|
@ -15,7 +15,8 @@
|
|||
add_forcedlogs/1,
|
||||
remove_forcedlogs/1,
|
||||
get_opts/0,
|
||||
save/1]).
|
||||
save/1,
|
||||
return_settings/0]).
|
||||
|
||||
|
||||
-record(log_options, {log_level = info :: log_level(),
|
||||
|
@ -24,7 +25,7 @@
|
|||
-type log_level() :: debug | info | warn | error | critical.
|
||||
-type log_options() :: #log_options{}.
|
||||
|
||||
-export_type([log_options/0]).
|
||||
-export_type([log_options/0, log_level/0]).
|
||||
|
||||
-define(LOG_LEVELS, [debug, info, warn, error, critical]).
|
||||
-define(DEFAULT_LOG_LEVEL, error).
|
||||
|
@ -442,6 +443,12 @@ get_opts() ->
|
|||
forced_logs = []}
|
||||
end.
|
||||
|
||||
-spec return_settings() -> {log_level(), list(string())}.
|
||||
%% @doc
|
||||
%% Return the settings outside of the record
|
||||
return_settings() ->
|
||||
LO = get_opts(),
|
||||
{LO#log_options.log_level, LO#log_options.forced_logs}.
|
||||
|
||||
%%%============================================================================
|
||||
%%% Prompt Logs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue