瀏覽代碼

Fix several typos

pull/295/head
Lee GiTack 9 年之前
父節點
當前提交
8b16d41201
共有 4 個文件被更改,包括 10 次插入10 次删除
  1. +1
    -1
      src/lager_app.erl
  2. +3
    -3
      src/lager_default_formatter.erl
  3. +5
    -5
      src/lager_file_backend.erl
  4. +1
    -1
      src/lager_transform.erl

+ 1
- 1
src/lager_app.erl 查看文件

@ -265,7 +265,7 @@ maybe_make_handler_id(Mod, Config) ->
%% Allow the backend to generate a gen_event handler id, if it wants to.
%% We don't use erlang:function_exported here because that requires the module
%% already be loaded, which is unlikely at this phase of startup. Using code:load
%% caused undesireable side-effects with generating code-coverage reports.
%% caused undesirable side-effects with generating code-coverage reports.
try Mod:config_to_id(Config) of
Id ->
{Id, Config}

+ 3
- 3
src/lager_default_formatter.erl 查看文件

@ -172,7 +172,7 @@ basic_test_() ->
[date, " ", time," [",severity,"] ",pid, " ", message, "\n"]
)))
},
{"Non existant metadata can default to string",
{"Non existent metadata can default to string",
?_assertEqual(iolist_to_binary([Date, " ", Time, " [error] Fallback Message\n"]),
iolist_to_binary(format(lager_msg:new("Message",
Now,
@ -182,7 +182,7 @@ basic_test_() ->
[date, " ", time," [",severity,"] ",{does_not_exist,"Fallback"}, " ", message, "\n"]
)))
},
{"Non existant metadata can default to other metadata",
{"Non existent metadata can default to other metadata",
?_assertEqual(iolist_to_binary([Date, " ", Time, " [error] Fallback Message\n"]),
iolist_to_binary(format(lager_msg:new("Message",
Now,
@ -192,7 +192,7 @@ basic_test_() ->
[date, " ", time," [",severity,"] ",{does_not_exist,pid}, " ", message, "\n"]
)))
},
{"Non existant metadata can default to a string2",
{"Non existent metadata can default to a string2",
?_assertEqual(iolist_to_binary(["Unknown Pid"]),
iolist_to_binary(format(lager_msg:new("Message",
Now,

+ 5
- 5
src/lager_file_backend.erl 查看文件

@ -83,19 +83,19 @@
-spec init([option(),...]) -> {ok, #state{}} | {error, bad_config}.
init({FileName, LogLevel}) when is_list(FileName), is_atom(LogLevel) ->
%% backwards compatability hack
%% backwards compatibility hack
init([{file, FileName}, {level, LogLevel}]);
init({FileName, LogLevel, Size, Date, Count}) when is_list(FileName), is_atom(LogLevel) ->
%% backwards compatability hack
%% backwards compatibility hack
init([{file, FileName}, {level, LogLevel}, {size, Size}, {date, Date}, {count, Count}]);
init([{FileName, LogLevel, Size, Date, Count}, {Formatter,FormatterConfig}]) when is_list(FileName), is_atom(LogLevel), is_atom(Formatter) ->
%% backwards compatability hack
%% backwards compatibility hack
init([{file, FileName}, {level, LogLevel}, {size, Size}, {date, Date}, {count, Count}, {formatter, Formatter}, {formatter_config, FormatterConfig}]);
init([LogFile,{Formatter}]) ->
%% backwards compatability hack
%% backwards compatibility hack
init([LogFile,{Formatter,[]}]);
init([{FileName, LogLevel}, {Formatter,FormatterConfig}]) when is_list(FileName), is_atom(LogLevel), is_atom(Formatter) ->
%% backwards compatability hack
%% backwards compatibility hack
init([{file, FileName}, {level, LogLevel}, {formatter, Formatter}, {formatter_config, FormatterConfig}]);
init(LogFileConfig) when is_list(LogFileConfig) ->
case validate_logfile_proplist(LogFileConfig) of

+ 1
- 1
src/lager_transform.erl 查看文件

@ -172,7 +172,7 @@ do_transform(Line, SinkName, Severity, Arguments0, Safety) ->
[Attrs, Format, Args] ->
{concat_lists(Attrs, DefaultAttrs), Format, Args}
end,
%% Generate some unique variable names so we don't accidentaly export from case clauses.
%% Generate some unique variable names so we don't accidentally export from case clauses.
%% Note that these are not actual atoms, but the AST treats variable names as atoms.
LevelVar = make_varname("__Level", Line),
TracesVar = make_varname("__Traces", Line),

Loading…
取消
儲存