On debug output

This is a discussion on On debug output within the SNMP Coders forums, part of the Networking and Network Related category; I am currently making over the debug module and have found a few odd corners where some more clarification could ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008
Magnus Fromreide
 
Posts: n/a
Default On debug output

I am currently making over the debug module and have found a few odd
corners where some more clarification could be helpful.

Currently debug_is_token_registered only checks if there exist an
enabled debug region that is a prefix of token.
I would like to modify the check to be if the longest module is enabled
or not.

Currently debug_print_everything can force us to print everything and
dodebug can force us to print nothing but there is no support for
setting the default policy.
I think it would be nice to be able to say that the default policy
should be to print everything or to not prit anything.

Currently dbg_tokens might contain multiple entries with the same token.
I think it would be reasonable to have a uniqueness condition on
dbg_tokens.

Currently the MIB maps to the code as follows:
nsDebugEnabled <=> !dodebug
nsDebugOutputAll <=> debug_print_everything
nsDebugDumpPdu <=> NETSNMP_DS_LIB_DUMP_PACKET

nsDebugTokenPrefix <=> debug_entry->token_name
nsDebugTokenStatus <=> debug_entry->status & SNMP_DEBUG_ACTIVE

I would like to add some more things to the mib:

nsDebugDefaultEnabled OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-write
STATUS current
DESCRIPTION "If debug output should be generated for items
without any specific instructions."
DEFVAL { true }
::= { nsConfigDebug 5 }

The mapping to code would be
nsDebugDefaultEnabled <=> <new variable with default action>

nsDebugTokenEnabled OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-create
STATUS current
DESCRIPTION "If debug output should be generated for items
with this prefix unless a more specialized
match exists."
DEFVAL { true }
::= { nsDebugTokenStatus 5 }

The mapping to code would be
nsDebugTokenEnabled <=> !(debug_entry->status & SNMP_DEBUG_EXCLUDED)

I am aware that there are some older deprecated but similar columns in
nsDebugTokenTable and since I haven't checked if my names clash I might
have to change some names in this proposal.

The effect I am searching is that one should be able to say that the
debug output is for instance:

+foo -foobar

or

+ALL -trace

Further, I am looking to support dynamic adding and removal of debug
tokens and finally all this should be accessible using the mib module. I
also intend to add undo support to the mib module.

Any comments on this?

/MF


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757...un.com/javaone
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:52 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0