IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 22 years ago

Closed 22 years ago

Last modified 21 years ago

#153 closed defect (fixed)

Inheritance of trace levels is incorrect

Reported by: rhl@… Owned by: george.gusciora@…
Priority: high Milestone:
Component: sys Version: unspecified
Severity: normal Keywords:
Cc:

Description

After
psTraceSetLevel("A.b.c", 5)
psTracePrintLevels()

. 0

A 5
b 5
c 5

psLib.psTraceGetLevel("A.b.c") = -9999
The correct answer is "5"

Note that the hierarchy is wrong here too, as reported in a previous bug report

rel2_2

Change History (5)

comment:1 by robert.desonia@…, 22 years ago

Owner: changed from robert.desonia@… to george.gusciora@…

comment:2 by gusciora@…, 22 years ago

Resolution: worksforme
Status: newclosed

Should be fixed in the current CVS version.

comment:3 by Paul Price, 22 years ago

Cc: price@… added
Resolution: worksforme
Status: closedreopened

This is not mentioned explicitly in the SDRS, but the property of inheritance
implies the following behaviour:

Say we have trace levels defined:
. 9

A 9

B 2

Then a call,

psTrace("A.B.C", 0, "This should appear");

should appear, because the level of A.B.C is inherited from A.B
As currently implemented, psTraceGetLevel returns PS_UNKNOWN_TRACE_LEVEL (for
which I recommend renaming to PS_TRACE_UNKNOWN_LEVEL to conform to the naming
convention), which causes the trace not to appear, so I suggest that
psTraceGetLevel returns the level of the closest leaf. Of course, this means
that if the level specified doesn't match anything, the level of the root (".")
should be returned.

comment:4 by gusciora@…, 22 years ago

Resolution: fixed
Status: reopenedclosed

comment:5 by Paul Price, 21 years ago

Verified:

int main(void)
{

psTraceSetLevel("blah", 5);
psTraceSetLevel("blah.blah", 8);

psTrace("blah.blah.blah", 3, "This should appear.\n");
psTrace("blah.blah.blah", 9, "This should NOT appear.\n");

}

==>

This should appear.

Note: See TracTickets for help on using tickets.