char *PromiseLoggingPromiseFinish(const EvalContext *eval_context, const Promise *pp) { LoggingPrivContext *pctx = LoggingPrivGetContext(); if (pctx == NULL) { ProgrammingError("Promise logging: Unable to finish promise, not bound to EvalContext"); } PromiseLoggingContext *plctx = pctx->param; if (plctx->eval_context != eval_context) { ProgrammingError("Promise logging: Unable to finish promise, bound to EvalContext different from passed one"); } if (EvalContextStackGetTopPromise(eval_context) != pp) { /* * FIXME: There are still cases where promise passed here is not on top of stack */ /* ProgrammingError("Logging: Attempt to finish promise not on top of stack"); */ } char *last_message = plctx->last_message; plctx->promise_level--; plctx->last_message = NULL; free(plctx->stack_path); LoggingPrivSetLevels(LogGetGlobalLevel(), LogGetGlobalLevel()); return last_message; }
void PromiseLoggingPromiseEnter(const EvalContext *eval_context, const Promise *pp) { LoggingPrivContext *pctx = LoggingPrivGetContext(); if (pctx == NULL) { ProgrammingError("Promise logging: Unable to enter promise, not bound to EvalContext"); } PromiseLoggingContext *plctx = pctx->param; if (plctx->eval_context != eval_context) { ProgrammingError("Promise logging: Unable to enter promise, bound to EvalContext different from passed one"); } if (EvalContextStackGetTopPromise(eval_context) != pp) { /* * FIXME: There are still cases where promise passed here is not on top of stack */ /* ProgrammingError("Logging: Attempt to set promise not on top of stack as current"); */ } plctx->promise_level++; plctx->stack_path = EvalContextStackPath(eval_context); LoggingPrivSetLevels(CalculateLogLevel(eval_context, pp), CalculateReportLevel(eval_context, pp)); }
void LogSetGlobalLevel(LogLevel level) { LoggingContext *lctx = GetCurrentThreadContext(); lctx->global_level = level; LoggingPrivSetLevels(level, level); }
void LogSetGlobalLevel(LogLevel level) { global_level = level; LoggingPrivSetLevels(level, level); }