jgdv.logging.decorators

Classes

LogCall

A Decorator for announcing the entry/exit of a function call

Module Contents

class jgdv.logging.decorators.LogCall(
enter=None,
exit=None,
level=logmod.INFO,
logger=None,
)[source]

Bases: jgdv.decorators.Decorator

A Decorator for announcing the entry/exit of a function call

eg: @LogCall(enter=”Entering”, exit=”Exiting”, level=logmod.INFO) def a_func()…

Parameters:
  • enter (jgdv.Maybe[str | jgdv.Lambda])

  • exit (jgdv.Maybe[str | jgdv.Lambda])

  • level (int | str)

  • logger (jgdv.Maybe[jgdv.logging._interface.Logger])

_log_msg(msg, fn, args, **kwargs) <Unknown>[source]
Parameters:
Return type:

None

abstractmethod _wrap_class(cls) <Unknown>[source]
Parameters:

cls (type[LogCall._wrap_class.T])

Return type:

type[LogCall._wrap_class.T]

_wrap_fn(fn) <Unknown>[source]
Parameters:

fn (collections.abc.Callable[LogCall._wrap_fn.I, LogCall._wrap_fn.O])

Return type:

collections.abc.Callable[LogCall._wrap_fn.I, LogCall._wrap_fn.O]

_wrap_method(fn) <Unknown>[source]
Parameters:

fn (collections.abc.Callable[Concatenate[LogCall._wrap_method.X, LogCall._wrap_method.I], LogCall._wrap_method.O])

Return type:

collections.abc.Callable[Concatenate[LogCall._wrap_method.X, LogCall._wrap_method.I], LogCall._wrap_method.O]

_enter_msg = None
_exit_msg = None
_logger