bundle.core.tracer¶
Attributes¶
Classes¶
Module Contents¶
- 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 = 2¶
- class bundle.core.tracer.Sync[source]¶
- static 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][source]¶
- static 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[source]¶
- class decorator[source]¶
- static 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]][source]¶
Decorator that wraps a synchronous callable to log its outcome. Returns a tuple (result, exception). Can be used with or without parameters.
- static 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][source]¶
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.
- class bundle.core.tracer.Async[source]¶
- static 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][source]¶
- Async:
- static 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[source]¶
- Async:
- class decorator[source]¶
- static 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]]][source]¶
Decorator that wraps an asynchronous callable to log its outcome. Returns a tuple (result, exception). Can be used with or without parameters.
- static 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]][source]¶
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.