#153 closed defect (fixed)
Inheritance of trace levels is incorrect
| Reported by: | Owned by: | ||
|---|---|---|---|
| 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 , 22 years ago
| Owner: | changed from to |
|---|
comment:2 by , 22 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
comment:3 by , 22 years ago
| Cc: | added |
|---|---|
| Resolution: | worksforme |
| Status: | closed → reopened |
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 , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
comment:5 by , 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.

Should be fixed in the current CVS version.