bundle.core.tracer ================== .. py:module:: bundle.core.tracer Attributes ---------- .. autoapisummary:: bundle.core.tracer.P bundle.core.tracer.R bundle.core.tracer.log bundle.core.tracer.DEFAULT_LOG_LEVEL bundle.core.tracer.DEFAULT_LOG_EXC_LEVEL bundle.core.tracer.DEFAULT_SYNC_CALL_STACKLEVEL Classes ------- .. autoapisummary:: bundle.core.tracer.Sync bundle.core.tracer.Async Module Contents --------------- .. py:data:: P .. py:data:: R .. py:data:: log .. py:data:: DEFAULT_LOG_LEVEL .. py:data:: DEFAULT_LOG_EXC_LEVEL .. py:data:: DEFAULT_SYNC_CALL_STACKLEVEL :value: 2 .. py:class:: Sync .. py:method:: call(func: collections.abc.Callable[P, R] | collections.abc.Callable[P, collections.abc.Awaitable[R]], *args: P, stacklevel: int = DEFAULT_SYNC_CALL_STACKLEVEL, log_level: bundle.core.logger.Level | None = None, exc_log_level: bundle.core.logger.Level | None = None, **kwargs: P) -> tuple[R | None, Exception | None] :staticmethod: .. py:method:: call_raise(func: collections.abc.Callable[P, R] | collections.abc.Callable[P, collections.abc.Awaitable[R]], *args: P, stacklevel: int = DEFAULT_SYNC_CALL_RAISE_STACKLEVEL, log_level: bundle.core.logger.Level | None = None, exc_log_level: bundle.core.logger.Level | None = None, **kwargs: P) -> R :staticmethod: .. py:class:: decorator .. py:method:: call(func: collections.abc.Callable[P, R] | collections.abc.Callable[P, collections.abc.Awaitable[R]] | None = None, *, stacklevel: int = DEFAULT_SYNC_DECORATOR_CALL_STACKLEVEL, log_level: bundle.core.logger.Level | None = None, exc_log_level: bundle.core.logger.Level | None = None) -> collections.abc.Callable[P, tuple[R | None, Exception | None]] :staticmethod: Decorator that wraps a synchronous callable to log its outcome. Returns a tuple (result, exception). Can be used with or without parameters. .. py:method:: call_raise(func: collections.abc.Callable[P, R] | collections.abc.Callable[P, collections.abc.Awaitable[R]] | None = None, *, stacklevel: int = DEFAULT_SYNC_DECORATOR_CALL_RAISE_STACKLEVEL, log_level: bundle.core.logger.Level | None = None, exc_log_level: bundle.core.logger.Level | None = None) -> collections.abc.Callable[P, R] :staticmethod: Decorator that wraps a synchronous callable to log its outcome. Returns the result directly or raises the logged exception. Can be used with or without parameters. .. py:class:: Async .. py:method:: call(func: collections.abc.Callable[P, R] | collections.abc.Callable[P, collections.abc.Awaitable[R]], *args: P, stacklevel: int = DEFAULT_ASYNC_CALL_STACKLEVEL, log_level: bundle.core.logger.Level | None = None, exc_log_level: bundle.core.logger.Level | None = None, **kwargs: P) -> tuple[R | None, BaseException | None] :staticmethod: :async: .. py:method:: call_raise(func: collections.abc.Callable[P, R] | collections.abc.Callable[P, collections.abc.Awaitable[R]], *args: P, stacklevel: int = DEFAULT_ASYNC_CALL_RAISE_STACKLEVEL, log_level: bundle.core.logger.Level | None = None, exc_log_level: bundle.core.logger.Level | None = None, **kwargs: P) -> R :staticmethod: :async: .. py:class:: decorator .. py:method:: call(func: collections.abc.Callable[P, R] | collections.abc.Callable[P, collections.abc.Awaitable[R]] | None = None, *, stacklevel: int = DEFAULT_ASYNC_DECORATOR_CALL_STACKLEVEL, log_level: bundle.core.logger.Level | None = None, exc_log_level: bundle.core.logger.Level | None = None) -> collections.abc.Callable[P, collections.abc.Awaitable[tuple[R | None, BaseException | None]]] :staticmethod: Decorator that wraps an asynchronous callable to log its outcome. Returns a tuple (result, exception). Can be used with or without parameters. .. py:method:: call_raise(func: collections.abc.Callable[P, R] | collections.abc.Callable[P, collections.abc.Awaitable[R]] | None = None, *, stacklevel: int = DEFAULT_ASYNC_DECORATOR_CALL_RAISE_STACKLEVEL, log_level: bundle.core.logger.Level | None = None, exc_log_level: bundle.core.logger.Level | None = None) -> collections.abc.Callable[P, collections.abc.Awaitable[R]] :staticmethod: Decorator that wraps an asynchronous callable to log its outcome. Returns the result directly or raises the logged exception. Can be used with or without parameters.