aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/misc/snmp_log.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-06-14 11:13:34 +0200
committerMicael Karlberg <[email protected]>2019-06-27 17:50:57 +0200
commit04b795f59e678e550fb8c7650952c5ded1096cef (patch)
tree27544878eff0b1063babbe3c2c8b3c61bc216852 /lib/snmp/src/misc/snmp_log.erl
parent331a5f531326da2d0ac23a1fa40c8a51a749c464 (diff)
downloadotp-04b795f59e678e550fb8c7650952c5ded1096cef.tar.gz
otp-04b795f59e678e550fb8c7650952c5ded1096cef.tar.bz2
otp-04b795f59e678e550fb8c7650952c5ded1096cef.zip
[snmp|agent] Dialyzer related changes
Changes to satisfy dialyzer. Including changing the definition of some of the behaviours (use the '-callback' attribute instead of an explicit behaviour_info/1 function). Also found and corrected some (apparently minor) bugs. OTP-15932
Diffstat (limited to 'lib/snmp/src/misc/snmp_log.erl')
-rw-r--r--lib/snmp/src/misc/snmp_log.erl18
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/snmp/src/misc/snmp_log.erl b/lib/snmp/src/misc/snmp_log.erl
index 9ae5c1109b..8a4dfa621b 100644
--- a/lib/snmp/src/misc/snmp_log.erl
+++ b/lib/snmp/src/misc/snmp_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2018. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2019. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -342,10 +342,9 @@ validate_loop({Cont, Terms, BadBytes}, Log, Validator, PrevTS, PrevSN) ->
?vtrace("validate_loop -> "
"~n NextTS: ~p"
"~n NextSN: ~p", [NextTS, NextSN]),
- validate_loop(disk_log:chunk(Log, Cont), Log, Validator, NextTS, NextSN);
--dialyzer({nowarn_function, validate_loop/5}). % Future compat
-validate_loop(Error, _Log, _Write, _PrevTS, _PrevSN) ->
- Error.
+ validate_loop(disk_log:chunk(Log, Cont), Log, Validator, NextTS, NextSN).
+%% validate_loop(Error, _Log, _Write, _PrevTS, _PrevSN) ->
+%% Error.
%% -- log ---
@@ -925,14 +924,7 @@ f(TimeStamp, SeqNo,
end,
format_tab(
"~w ~s - ~s [~s]~s ~w\n~s",
- [Class, AddrStr, HdrStr, TimeStamp, SeqNo, Vsn, Str]);
-f(TimeStamp, SeqNo, Msg, AddrStr, _Mib) ->
- io:format("<ERROR> Unexpected data: "
- "~n TimeStamp: ~s~s"
- "~n Msg: ~p"
- "~n AddrStr: ~p"
- "~n", [TimeStamp, SeqNo, Msg, AddrStr]),
- throw({error, 'invalid-message'}).
+ [Class, AddrStr, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
f(F, A) ->
lists:flatten(io_lib:format(F, A)).