Permalink
Browse files

Merge pull request #92 from lukyanov/file_backend_formatter_fix2

Fix custom formatter spec for lager_file_backend (version 2)
  • Loading branch information...
2 parents d648264 + 9151da2 commit 464644836ff219b46bc7835a4e736d7092010be5 @Vagabond Vagabond committed Nov 28, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/lager_app.erl
View
@@ -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}.
@@ -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"]}]
]
}])
)

0 comments on commit 4646448

Please sign in to comment.