Skip to main content

StreamedLogSync

Sync variant of StreamedLog that is logging in threads.

Hierarchy

Index

Methods

__enter__

  • __enter__(): Self
  • Start the streaming thread within the context. Exiting the context will finish the streaming thread.


    Returns Self

__exit__

  • __exit__(exc_type, exc_val, exc_tb): None
  • Stop the streaming thread.


    Parameters

    • exc_type: type[BaseException] | None
    • exc_val: BaseException | None
    • exc_tb: TracebackType | None

    Returns None

__init__

  • __init__(to_logger, *, from_start): None
  • Initialize StreamedLog.


    Parameters

    • to_logger: logging.Logger

      The logger to which the logs will be redirected.

    • optionalkeyword-onlyfrom_start: bool = True

      If True, all logs from the start of the actor run will be redirected. If False, only newly arrived logs will be redirected. This can be useful for redirecting only a small portion of relevant logs for long-running actors in stand-by.

    Returns None

start

  • start(): Thread
  • Start the streaming thread. The caller has to handle any cleanup by manually calling the stop method.


    Returns Thread

stop

  • stop(): None
  • Signal the streaming thread to stop logging and wait for it to finish.


    Returns None

Page Options