A fancy plugin to boost up your logging with loguru
Simply execute:
pip install loguru-mypy
And later on modify your mypy.ini
configuration file with
[mypy]
plugins = loguru_mypy
That is all, your code is now ready to be linted.
loguru-mypy
is obviously a mypy plugin that allows to avoid
some of those little runtime trickeries :).
Here is a short attempt to list some of those:
logger.opt(lazy=True)
in facts returns a logger
that we call lazy. Lazy loggers accept only
typing.Callable[[], t.Any]
in place of positional or named arguments. Passing a callable that
accepts even a single argument thus results in runtime error. loguru-mypy
detects that fact
and lets you know before your runtime reaches that portion of a code.