On 08/01/07, Clement Hsu wrote:
> But I don't realize how to use DEBUGMSG( ) correct.

Please see the existing code for examples.

$ cd agent
$ grep DEBUGMSG *.c

snmp_perl.c: DEBUGMSGTL(("perl", "calling perl\n"));
snmpd.c: DEBUGMSGTL(("snmpd/main", "Bye...\n"));

DEBUGMSG takes two parameters - the debug token (as passed to -D)
and the debug string to print.

If you want to display variable values, use printf-style strings, such as:

snmp_vars.c: DEBUGMSGTL(("mib_init", "initializing: %s\n", module_name));

> For example:

> DEBUGMSG("ucdSnmpTutorialMIB Initializing", "\n"));

I'm sorry - I don't believe that compiles.
Just look at the number of parentheses you've got.
You open one, but close two.

That's *not* the same as the DEBUGMSG statements in the main code.
Either you're being careless when writing your code, or when copying it
into email messages. Either way, such carelessness makes it much
harder to offer advice. Please try and check what you're doing against
existing code much more closely. Thanks.


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
Net-snmp-coders mailing list