The old process manager's `Trace` function by default calls `log.Printf`
to output "trace" level logs. That's not ideal because by default the
trace level logs should not be outputted. In history it didn't cause
problems because there was no other call to the process manager before
the logger system's initialization.
But if there is any package using the process manager before the "Trace"
function gets assigned to the logger system's trace function, the
process manager will outputs unexpected verbose messages, this behavior
is not expected in most cases.
Now, the logger system also uses process manager to manage its goroutine
contexts, so it's the time to fix the old "trace" behavior: by default,
do not output the trace level messages. Fix#24951
// the "process manager" also calls "log.Trace()" to output logs, so if we want to create new contexts by the manager, we need to disable the trace temporarily
// the "process manager" also calls "log.Trace()" to output logs, so if we want to create new contexts by the manager, we need to disable the trace temporarily
// - it is simply an alias for context.CancelFunc and is only for documentary purposes
// - it is simply an alias for context.CancelFunc and is only for documentary purposes
typeFinishedFunc=context.CancelFunc
typeFinishedFunc=context.CancelFunc
varTrace=defaultTrace// this global can be overridden by particular logging packages - thus avoiding import cycles
var(
traceDisabledatomic.Int64
TraceCallback=defaultTraceCallback// this global can be overridden by particular logging packages - thus avoiding import cycles
)
// defaultTraceCallback is a no-op. Without a proper TraceCallback (provided by the logger system), this "Trace" level messages shouldn't be outputted.