Permalink
Browse files

Merge pull request #376 from priestjim/feature/fix-dialyzer-warnings

Fix dialyzer warnings
  • Loading branch information...
2 parents 571aa65 + 7598d8c commit 81eaef0ce98fdbf64ab95665e3bc2ec4b24c7dac @nickelization nickelization committed on GitHub Oct 5, 2016
Showing with 9 additions and 9 deletions.
  1. +3 −3 src/lager_crash_log.erl
  2. +6 −6 src/lager_file_backend.erl
View
@@ -46,8 +46,8 @@
-record(state, {
name :: string(),
- fd :: pid(),
- inode :: integer(),
+ fd :: pid() | undefined,
+ inode :: integer() | undefined,
fmtmaxbytes :: integer(),
size :: integer(),
date :: undefined | string(),
@@ -119,7 +119,7 @@ schedule_rotation(Date) ->
%% ===== Begin code lifted from riak_err =====
-spec limited_fmt(string(), list(), integer()) -> iolist().
-%% @doc Format Fmt and Args similar to what io_lib:format/2 does but with
+%% @doc Format Fmt and Args similar to what io_lib:format/2 does but with
%% limits on how large the formatted string may be.
%%
%% If the Args list's size is larger than TermMaxSize, then the
View
@@ -57,8 +57,8 @@
-record(state, {
name :: string(),
level :: {'mask', integer()},
- fd :: file:io_device(),
- inode :: integer(),
+ fd :: file:io_device() | undefined,
+ inode :: integer() | undefined,
flap=false :: boolean(),
size = 0 :: integer(),
date :: undefined | string(),
@@ -81,7 +81,7 @@
{check_interval, non_neg_integer()} | {formatter, atom()} |
{formatter_config, term()}.
--spec init([option(),...]) -> {ok, #state{}} | {error, bad_config}.
+-spec init([option(),...]) -> {ok, #state{}} | {error, {fatal,bad_config}}.
init({FileName, LogLevel}) when is_list(FileName), is_atom(LogLevel) ->
%% backwards compatibility hack
init([{file, FileName}, {level, LogLevel}]);
@@ -158,7 +158,7 @@ handle_event({log, Message},
NewState = case Drop > 0 of
true ->
Report = io_lib:format(
- "lager_file_backend dropped ~p messages in the last second that exceeded the limit of ~p messages/sec",
+ "lager_file_backend dropped ~p messages in the last second that exceeded the limit of ~p messages/sec",
[Drop, Hwm]),
ReportMsg = lager_msg:new(Report, warning, [], []),
write(State, lager_msg:timestamp(ReportMsg),
@@ -652,7 +652,7 @@ filesystem_test_() ->
lager:log(error, self(), "Test message1"),
gen_event:call(lager_event, {lager_file_backend, "test.log"}, rotate, infinity),
lager:log(error, self(), "Test message1"),
- ?assert(filelib:is_regular("test.log.0"))
+ ?assert(filelib:is_regular("test.log.0"))
end
},
{"sync_on option should work",
@@ -832,7 +832,7 @@ trace_files_test_() ->
catch ets:delete(lager_config),
application:unset_env(lager, traces),
application:stop(lager),
-
+
file:delete("events.log"),
file:delete("test.log"),
file:delete("debug.log"),

0 comments on commit 81eaef0

Please sign in to comment.