Skip to content

Commit

Permalink
File backends started as part of a trace have a loglevel of 'none'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagabond committed Dec 20, 2012
1 parent c809630 commit 351e482
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lager.erl
Expand Up @@ -115,7 +115,7 @@ trace_file(File, Filter, Level) ->
false ->
%% install the handler
supervisor:start_child(lager_handler_watcher_sup,
[lager_event, {lager_file_backend, File}, {File, Level}]);
[lager_event, {lager_file_backend, File}, {File, none}]);
_ ->
{ok, exists}
end,
Expand Down
2 changes: 2 additions & 0 deletions src/lager_file_backend.erl
Expand Up @@ -412,6 +412,8 @@ filesystem_test_() ->
file:delete("foo.log"),
{ok, _} = lager:trace_file("foo.log", [{module, ?MODULE}]),
lager:error("Test message"),
%% not elegible for trace
lager:log(error, self(), "Test message"),
{ok, Bin3} = file:read_file("foo.log"),
?assertMatch([_, _, "[error]", _, "Test message\n"], re:split(Bin3, " ", [{return, list}, {parts, 5}]))
end
Expand Down

0 comments on commit 351e482

Please sign in to comment.