Skip to content

Commit

Permalink
[ 1379313 ] sfcb tracing cumbersome. Now the trace level will be set to
Browse files Browse the repository at this point in the history
1, if the SFCB_TRACE environment variable has not been set.
  • Loading branch information
mihajlov committed Dec 13, 2005
1 parent 4592da4 commit 383c91b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README
Expand Up @@ -527,7 +527,9 @@ SFCB_PAUSE_HTTP
SFCB_TRACE=[0..4]
Specifies the level of trace/debug messages for sfcb.
Valid values are 0 (no trace messages), or 1 (key trace messages only)
to 4 (all messages). Note: SFCB_TRACE level is used in conjunction
to 4 (all messages). If not set, a default trace level of 1 will be
assumed for tracing.
Note: SFCB_TRACE level is used in conjunction
with sfcb's component-level tracing (see Section 11) to control the
level of detail of trace messages to display within each component.

Expand Down
5 changes: 3 additions & 2 deletions man/sfcbd.1.pre.in
Expand Up @@ -11,7 +11,7 @@ entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
..

.TH sfcbd 1 "August 2005" "sfcb Version @PACKAGE_VERSION@"
.TH sfcbd 1 "December 2005" "sfcb Version @PACKAGE_VERSION@"

.SH NAME
sfcbd \- Open Source Small-Footprint CIM Broker (sfcb)
Expand Down Expand Up @@ -192,7 +192,8 @@ to the process.
.B SFCB_TRACE
Specifies the level of trace/debug messages for sfcb.
Valid values are 0 (no trace messages), or 1 (key trace messages only)
to 4 (all messages).
to 4 (all messages). A default value of 1 will be assumed, if this
variable is not set.
.br
[Note: SFCB_TRACE level is used in conjunction
with sfcb's component-level tracing to control the
Expand Down
2 changes: 1 addition & 1 deletion sfcBroker.c
Expand Up @@ -469,7 +469,7 @@ int main(int argc, char *argv[])
remove("sfcbStat");
}

_sfcb_set_trace_mask(tmask);
_SFCB_TRACE_START(1,tmask);

setupControl(configfile);
// SFCB_DEBUG
Expand Down
4 changes: 3 additions & 1 deletion trace.c
Expand Up @@ -74,7 +74,9 @@ TraceId traceIds[]={

void _sfcb_trace_start(int n)
{
_sfcb_debug = n;
if (_sfcb_debug < n) {
_sfcb_debug = n;
}
}

void _sfcb_trace_stop()
Expand Down
5 changes: 3 additions & 2 deletions trace.h
Expand Up @@ -46,8 +46,9 @@
#define _SFCB_TRACE_INIT() \
_sfcb_trace_init();

#define _SFCB_TRACE_START(n) \
_sfcb_trace_start(n);
#define _SFCB_TRACE_START(n,m) {\
_sfcb_trace_start(n); \
_sfcb_set_trace_mask(m); }

#define _SFCB_TRACE_STOP() \
_sfcb_trace_stop();
Expand Down

0 comments on commit 383c91b

Please sign in to comment.