Skip to content

Commit

Permalink
Fix custom formatter spec for lager_file_backend (version 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukyanov committed Nov 26, 2012
1 parent d648264 commit 9151da2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lager_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ to_config({Name,Severity}) ->
{{lager_file_backend, Name}, {Name, Severity}};
to_config({Name,_Severity,_Size,_Rotation,_Count}=Config) ->
{{lager_file_backend, Name}, Config};
to_config({Name,Severity,Size,Rotation,Count,Format}) ->
{{lager_file_backend, Name}, {Name,Severity,Size,Rotation,Count},Format}.
to_config([{Name,_Severity,_Size,_Rotation,_Count}, _Format] = Config) ->
{{lager_file_backend, Name}, Config}.



Expand All @@ -109,11 +109,11 @@ application_config_mangling_test_() ->
))},
{"Explode with formatter info",
?_assertMatch(
[{{lager_file_backend,"test.log"}, {"test.log", debug, 10485760, "$D0", 5},{lager_default_formatter,["[",severity,"] ", message, "\n"]}},
{{lager_file_backend,"test2.log"}, {"test2.log",debug, 10485760, "$D0", 5},{lager_default_formatter,["2>[",severity,"] ", message, "\n"]}}],
[{{lager_file_backend,"test.log"}, [{"test.log", debug, 10485760, "$D0", 5},{lager_default_formatter,["[",severity,"] ", message, "\n"]}]},
{{lager_file_backend,"test2.log"}, [{"test2.log",debug, 10485760, "$D0", 5},{lager_default_formatter,["2>[",severity,"] ", message, "\n"]}]}],
expand_handlers([{lager_file_backend, [
{"test.log", debug, 10485760, "$D0", 5,{lager_default_formatter,["[",severity,"] ", message, "\n"]}},
{"test2.log",debug, 10485760, "$D0", 5,{lager_default_formatter,["2>[",severity,"] ",message, "\n"]}}
[{"test.log", debug, 10485760, "$D0", 5},{lager_default_formatter,["[",severity,"] ", message, "\n"]}],
[{"test2.log",debug, 10485760, "$D0", 5},{lager_default_formatter,["2>[",severity,"] ",message, "\n"]}]
]
}])
)
Expand Down

0 comments on commit 9151da2

Please sign in to comment.