spacr.logger

Legacy stdout logger compatibility helpers.

Functions

configure_logger(→ logging.Logger)

Return a named logger backed by a rotating file in the user's home.

log_function_call(func)

Decorator that logs call arguments, return value, and exceptions.

Module Contents

spacr.logger.configure_logger(name: str = _LOGGER_NAME, log_file_name: str = 'spacr.log', level: int = logging.INFO, stream: bool = False) logging.Logger[source]

Return a named logger backed by a rotating file in the user’s home.

Repeated calls reuse handlers installed here, update their levels, and may add the optional stream handler later. Handlers installed by callers are preserved; a bootstrap logging.NullHandler does not count as file logging.

Parameters:
  • name – Logger name to fetch or create. Default "spacr".

  • log_file_name – file name under the user’s home for the first file handler installed for name. Later calls keep that file.

  • level – Logging level applied to the logger and its handlers.

  • stream – When True, also attach a stderr stream handler.

Returns:

Configured logging.Logger instance.

spacr.logger.log_function_call(func)[source]

Decorator that logs call arguments, return value, and exceptions.

Parameters:

func – Callable to wrap.

Returns:

Wrapped callable that emits INFO-level trace entries.