loguru icon indicating copy to clipboard operation
loguru copied to clipboard

missing isEnabledFor

Open hemna opened this issue 9 months ago • 1 comments

It seems that logger is missing the test isEnabledFor() method.

https://docs.python.org/3/library/logging.html#logging.Logger.isEnabledFor

hemna avatar Sep 19 '23 16:09 hemna

You can achieve a similar functionality as isEnabledFor() by using opt(lazy=True) in Loguru. See documentation here.

def expensive_func():
    ...

logger.opt(lazy=True).debug("Debug data: {}", expensive_func)

Delgan avatar Sep 19 '23 16:09 Delgan