[OpenSER-Devel] [ openser-Patches-1728481 ] Debug level changeable during runtime

SourceForge.net noreply at sourceforge.net
Thu Jul 12 11:50:52 CEST 2007


Patches item #1728481, was opened at 2007-05-30 21:35
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1728481&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: ver 1.2.x
Status: Open
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Anatoly Pidruchny (apidruchny)
Assigned to: Bogdan (bogdan_iancu)
Summary: Debug level changeable during runtime

Initial Comment:
The proposed patch allows to change the debug level during runtime using the command:

openserctl unixsock debug <new level>

Just to get the current debug level, use the command:

openserctl unixsock debug


The feature is implemented by putting the debug level into the shared memory. The type of the global variable "debug" has been changed from int to a pointer to int.

This patch also has some improvements of the logging subsystem in the case when log_stderr logging is used:
1. Timestamp of each message is printed in the header.
2. The level of each log message is printed in the header.
3. C library functions fprintf, vfprintf and fflush are no longer used. The problem with these functions was that sometimes log messages from other openser processes were printed between a header and a body of a log message. If a lot of log messages are printed at the same time from different processes then this causes a hardly readable mess. The solution is to use our own buffer in dprint.c to construct the full log message, then print it as a whole thing using the write system call.

----------------------------------------------------------------------

>Comment By: Bogdan (bogdan_iancu)
Date: 2007-07-12 12:50

Message:
Logged In: YES 
user_id=1275325
Originator: NO

Hi Anatoly,

I commited the patch on SVN with the following notes:
   - extended to enable/disable at compile time the configurable debug
level.
   - proper MI integration
   - extension for dprint still not commited - I want to get a closer look
and see the impact of it.

Question: what is the purpose of :
  debug_init = *debug;
  debug = &debug_init;

at shutdown? I understand that you keep the value and move the pointer to
the local variable, but why?

Regards,
Bogdan

----------------------------------------------------------------------

Comment By: Bogdan (bogdan_iancu)
Date: 2007-07-06 14:41

Message:
Logged In: YES 
user_id=1275325
Originator: NO

Hi Anatoly,

I will review and integrate it with some idea I have regarding the debug
parameter.

Thanks and regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1728481&group_id=139143



More information about the Devel mailing list