[AGENT++] LOG moved from agent++ to snmp++ lib...

Fedja Jeleskovic mrawd2 at gmail.com
Thu Mar 10 23:40:46 CET 2005


Hi there,

 

I know that this was mentioned before as something to be done in the future, but I took a look and moved log.cpp and log.h down from the agent++ library into the snmp++ lib. Besides a small change required to the log files, only other file that was changed is snmp++/src/v3.cpp. Of course make file for the agent++ had to be modified to exclude hard coded references to the log.cpp file and I guess appropriate changes are required for the agent++.dsp file as well.

 

SNMP++ library retained its debugprintf() and debughexcprintf() functions as a source for the all of the messages, but output is redirected into the old LOG macros. Eventually, rest of the code can be cleaned up and replaced with macros, but as of now it seems to be fine as is. For any new development macros could/should be used as well.

 

debug_set_logfile() function from v3.cpp is now obsolete, so it could be removed since there is no use for it.

 

Log file synchronization was also changed, so instead of ThreadManager() object there is not SnmpSynchronized() class instead.

 

As an extra part, log files are modified to support maximum log file size. Default is currently 1Mb, but you can specify any value you wish through the Log constructor. Once the log file gets filled up, it creates a backup version of that file and opens a new one for more writing.

 

Let me know if you want this to be included into the code.

 

 

Fedja

ps. all of the old names for the objects in the log.cpp and .h are still the same and carry that Agent in the front of everything. It doesn't hurt, but it could be changed to something else instead if someone insist...



More information about the AGENTPP mailing list