Skip to content

Commit

Permalink
enable log level
Browse files Browse the repository at this point in the history
  BugzID: 85978
  • Loading branch information
wenwl committed Jul 8, 2020
1 parent 21c8716 commit 6aa102e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/basho_bench.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ setup_benchmark(Opts, Configs) ->
TestDir = test_dir(Opts, BenchName),
application:set_env(basho_bench, test_dir, TestDir),
basho_bench_config:set(test_id, BenchName),
ConsoleLagerLevel = application:get_env(basho_bench, log_level, debug),
ConsoleLagerLevel = application:get_env(basho_bench, level, debug),

ErrorLog = filename:join([TestDir, "error.log"]),
ConsoleLog = filename:join([TestDir, "console.log"]),
CrashLog = filename:join([TestDir, "crash.log"]),
Expand All @@ -62,10 +63,6 @@ setup_benchmark(Opts, Configs) ->
application:set_env(lager, crash_log, CrashLog),
load_apps([lager, basho_bench]),
lager:start(),
%% Log level can be overriden by the config files
CustomLagerLevel = basho_bench_config:get(log_level, debug),
lager:set_loglevel(lager_console_backend, CustomLagerLevel),
lager:set_loglevel(lager_file_backend, ConsoleLog, CustomLagerLevel),
case basho_bench_config:get(distribute_work, false) of
true -> setup_distributed_work();
false -> ok
Expand All @@ -87,7 +84,10 @@ setup_benchmark(Opts, Configs) ->
%% Make sure this happens after starting lager or failures wont
%% show.
basho_bench_config:load(Configs),

%% Log level can be overriden by the config files
CustomLagerLevel = basho_bench_config:get(level, info),
lager:set_loglevel(lager_console_backend, CustomLagerLevel),
lager:set_loglevel(lager_file_backend, ConsoleLog, CustomLagerLevel),
%% Copy the config into the test dir for posterity
[ begin {ok, _} = file:copy(Config, filename:join(TestDir, filename:basename(Config))) end
|| Config <- Configs ],
Expand Down

0 comments on commit 6aa102e

Please sign in to comment.