Skip to content

Commit

Permalink
HPCC-30298 Allow tracing detail level to be controlled by tracing flags
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed Sep 15, 2023
1 parent 5a34bb0 commit 919059f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 10 additions & 2 deletions system/jlib/jlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3383,10 +3383,18 @@ TraceFlags loadTraceFlags(const IPropertyTree *ptree, const std::initializer_lis
attrName.clear().appendf("_%s", o.name);
if (ptree->hasProp(attrName))
{
if (ptree->getPropBool(attrName, false))
if (o.value <= TraceFlags::LevelMask)
{
dft &= ~TraceFlags::LevelMask;
dft |= o.value;
}
else
dft &= ~o.value;
{
if (ptree->getPropBool(attrName, false))
dft |= o.value;
else
dft &= ~o.value;
}
}

}
Expand Down
10 changes: 10 additions & 0 deletions system/jlib/jtrace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ BITMASK_ENUM(TraceFlags);

// Feature trace flags for hthor, thor and Roxie engines

// Detail levels
constexpr TraceFlags traceNone = TraceFlags::None;
constexpr TraceFlags traceStandard = TraceFlags::Standard;
constexpr TraceFlags traceDetailed = TraceFlags::Detailed;
constexpr TraceFlags traceMax = TraceFlags::Max;

// Common to several engines
constexpr TraceFlags traceHttp = TraceFlags::flag1;
constexpr TraceFlags traceSockets = TraceFlags::flag2;
Expand Down Expand Up @@ -158,6 +164,10 @@ struct TraceOption { const char * name; TraceFlags value; };

constexpr std::initializer_list<TraceOption> roxieTraceOptions
{
TRACEOPT(traceNone),
TRACEOPT(traceStandard),
TRACEOPT(traceDetailed),
TRACEOPT(traceMax),
TRACEOPT(traceHttp),
TRACEOPT(traceSockets),
TRACEOPT(traceCassandra),
Expand Down

0 comments on commit 919059f

Please sign in to comment.