Skip to content

set_log_context

gepa.optimize_anything.set_log_context(ctx: LogContext) -> None

Set the log context on the current thread.

Call this at the start of a child thread to route oa.log() output into the parent evaluator's log buffer. See :func:get_log_context for a complete usage example.

Source code in gepa/optimize_anything.py
def set_log_context(ctx: LogContext) -> None:
    """Set the log context on the current thread.

    Call this at the start of a child thread to route ``oa.log()`` output
    into the parent evaluator's log buffer.  See :func:`get_log_context`
    for a complete usage example.
    """
    _set_log_context(ctx)