User DEBUG static flag to reduce logging overhead
parent
5f4bacee39
commit
81f88b2473
|
@ -81,7 +81,8 @@ namespace ln.snmp
|
||||||
IPEndPoint remoteEndpoint = new IPEndPoint(IPAddress.Any, 0);
|
IPEndPoint remoteEndpoint = new IPEndPoint(IPAddress.Any, 0);
|
||||||
byte[] datagram = LocalEndpoint.Receive(ref remoteEndpoint);
|
byte[] datagram = LocalEndpoint.Receive(ref remoteEndpoint);
|
||||||
|
|
||||||
Logging.Log(LogLevel.DEBUGDETAIL,"SNMPClient: Received: {0}", BitConverter.ToString(datagram));
|
if (DEBUG)
|
||||||
|
Logging.Log(LogLevel.DEBUGDETAIL,"SNMPClient: Received: {0}", BitConverter.ToString(datagram));
|
||||||
|
|
||||||
ASN1Value asn = new ASN1Value(datagram);
|
ASN1Value asn = new ASN1Value(datagram);
|
||||||
SnmpMessage snmpMessage = asn;
|
SnmpMessage snmpMessage = asn;
|
||||||
|
|
|
@ -22,13 +22,17 @@ namespace ln.snmp.types
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public SnmpV2Message(ASN1Value value)
|
public SnmpV2Message(ASN1Value value)
|
||||||
:this()
|
: this()
|
||||||
{
|
{
|
||||||
snmpCommunity = (OctetString)value.Items[1];
|
snmpCommunity = (OctetString)value.Items[1];
|
||||||
|
|
||||||
Logging.Log(LogLevel.DEBUG, "ASN1Value->PDU: {0}", value.Items[2]);
|
if (SNMPEngine.DEBUG)
|
||||||
|
Logging.Log(LogLevel.DEBUG, "ASN1Value->PDU: {0}", value.Items[2]);
|
||||||
|
|
||||||
snmpPDU = (PDU)value.Items[2];
|
snmpPDU = (PDU)value.Items[2];
|
||||||
Logging.Log(LogLevel.DEBUG, "PDU: {0}", snmpPDU);
|
|
||||||
|
if (SNMPEngine.DEBUG)
|
||||||
|
Logging.Log(LogLevel.DEBUG, "PDU: {0}", snmpPDU);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Variable[] Items
|
public override Variable[] Items
|
||||||
|
|
Loading…
Reference in New Issue