yasmin_editor.runtime.logging module

Logging utilities for the YASMIN editor runtime.

This module encapsulates the runtime log buffer, YASMIN logger integration, tree-style indentation for nested containers, and duplicate suppression.

class yasmin_editor.runtime.logging.RuntimeLogger(append_callback: Callable[[str], None], clear_callback: Callable[[], None], is_disposed: Callable[[], bool])

Bases: object

Bridge YASMIN logging into the editor runtime log view.

The logger stores runtime log lines in memory, forwards them to Qt via callbacks, and keeps track of visual depth for nested container execution.

append(message: str, depth: int | None = None, is_end: bool = False) None

Append a log line while filtering accidental duplicate bursts.

Args:

message: Text to append to the runtime log buffer. depth: Optional explicit nesting depth. If omitted, the currently

tracked visual depth is used.

is_end: Whether the line should use the visual end-branch marker.

clear() None

Reset the in-memory runtime log buffer.

configure() None

Install the runtime logger callback into YASMIN.

decrement_depth() None

Decrease the visual log depth after leaving a container.

get_depth() int

Return the current visual log depth.

get_log_level_name() str

Return the active YASMIN log level as an uppercase string.

get_logs() list[str]

Return a copy of the collected runtime log lines.

increment_depth() None

Increase the visual log depth after entering a container.

reset_depth() None

Reset the visual log depth to the top level.

set_log_level(level: yasmin.LogLevel | str, emit_status: bool = True) None

Update the active YASMIN log level.

Args:

level: Target log level as a yasmin.LogLevel or its name. emit_status: Whether the log view should receive a status line.