From 2a82321d9c4aea154161c79f55d7854ae182d002 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 27 Mar 2019 15:39:16 +0100 Subject: [snmp|agent] Verbose (debug) improvements Added VMODULE for the two new modules. Also, improved some verbose printouts. OTP-15691 --- lib/snmp/src/agent/snmpa_get.erl | 1 + lib/snmp/src/agent/snmpa_get_lib.erl | 7 ++++--- lib/snmp/src/agent/snmpa_trap.erl | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/snmp/src/agent/snmpa_get.erl b/lib/snmp/src/agent/snmpa_get.erl index 50aab6b487..e67975a67d 100644 --- a/lib/snmp/src/agent/snmpa_get.erl +++ b/lib/snmp/src/agent/snmpa_get.erl @@ -33,6 +33,7 @@ do_get_bulk/7 ]). +-define(VMODULE,"GET"). -include("snmpa_internal.hrl"). -include("snmp_types.hrl"). -include("snmp_debug.hrl"). diff --git a/lib/snmp/src/agent/snmpa_get_lib.erl b/lib/snmp/src/agent/snmpa_get_lib.erl index 7929b10cf3..eaf7fe2641 100644 --- a/lib/snmp/src/agent/snmpa_get_lib.erl +++ b/lib/snmp/src/agent/snmpa_get_lib.erl @@ -43,6 +43,7 @@ user_err/2 ]). +-define(VMODULE,"GET-LIB"). -include("snmpa_internal.hrl"). -include("snmp_types.hrl"). -include("snmp_debug.hrl"). @@ -226,7 +227,7 @@ dbg_apply(M, F, A) -> silence -> apply(M,F,A); _ -> - ?vlog("~n apply: ~w,~w,~p~n", [M,F,A]), + ?vlog("~n apply: ~w, ~w, ~p~n", [M,F,A]), Res = (catch apply(M,F,A)), case Res of {'EXIT', Reason} -> @@ -237,9 +238,9 @@ dbg_apply(M, F, A) -> "~n" "~nresulted in an exit" "~n" - "~n ~p", [M, F, A, Reason]); + "~n ~p~n", [M, F, A, Reason]); _ -> - ?vlog("~n returned: ~p", [Res]) + ?vlog("~n returned: ~p~n", [Res]) end, Res end. diff --git a/lib/snmp/src/agent/snmpa_trap.erl b/lib/snmp/src/agent/snmpa_trap.erl index e75016f7ec..31805c3bee 100644 --- a/lib/snmp/src/agent/snmpa_trap.erl +++ b/lib/snmp/src/agent/snmpa_trap.erl @@ -917,7 +917,7 @@ do_send_v2_trap(Recvs, Vbs, ExtraInfo, NetIf) -> TrapPdu = make_v2_notif_pdu(Vbs, 'snmpv2-trap'), AddrCommunities = mk_addr_communities(Recvs), lists:foreach(fun({Community, Addrs}) -> - ?vtrace("~n send v2 trap to ~p",[Addrs]), + ?vtrace("send v2 trap to ~p",[Addrs]), NetIf ! {send_pdu, 'version-2', TrapPdu, {community, Community}, Addrs, ExtraInfo} end, AddrCommunities), -- cgit v1.2.3