[AGENT++] snmp++ console output

Jochen Katz katz at agentpp.com
Wed Jul 4 10:46:34 CEST 2007


Hi,

Altaf Aali schrieb:
> The snmp++ library outputs lots of logs to the console. Is there a way to
> get that output to a buffer or a different file at runtime or to not
> have it output at all?

To disable logging completely:
# grep LOGG include/snmp_pp/config_snmp_pp.h
// define _NO_LOGGING if you do not want any logging output
//#define _NO_LOGGING

Set filters at runtime
   // Set filter for logging
   DefaultLog::log()->set_filter(ERROR_LOG, 2);
   DefaultLog::log()->set_filter(WARNING_LOG, 1);
   DefaultLog::log()->set_filter(EVENT_LOG, 0);
   DefaultLog::log()->set_filter(INFO_LOG, 0);
   DefaultLog::log()->set_filter(DEBUG_LOG, 0);

You can redirect logging output to a file through setting a new
AgentLogImpl instance with desired settings to DefaultLog::init().

Regards,
  Jochen





More information about the AGENTPP mailing list