diff options
Diffstat (limited to 'Omni')
-rw-r--r-- | Omni/Bild/Deps/Python.nix | 14 | ||||
-rw-r--r-- | Omni/Log.py | 6 |
2 files changed, 16 insertions, 4 deletions
diff --git a/Omni/Bild/Deps/Python.nix b/Omni/Bild/Deps/Python.nix index e36896a..9af4630 100644 --- a/Omni/Bild/Deps/Python.nix +++ b/Omni/Bild/Deps/Python.nix @@ -1 +1,13 @@ -[ "cryptography" "llm" "mypy" "nltk" "slixmpp" "flask" "openai" "ludic" ] +[ + "cryptography" + "flask" + "llm" + "ludic" + "mypy" + "nltk" + "openai" + "slixmpp" + "sqids" + "starlette" + "uvicorn" +] diff --git a/Omni/Log.py b/Omni/Log.py index 2fbd007..e644a1a 100644 --- a/Omni/Log.py +++ b/Omni/Log.py @@ -1,6 +1,5 @@ """Setup logging like Omni/Log.hs.""" -# noqa: builtin-attribute-shadowing import logging import typing @@ -14,10 +13,10 @@ class LowerFormatter(logging.Formatter): return super(logging.Formatter, self).format(record) # type: ignore[misc] -def setup() -> None: +def setup(level: int = logging.INFO) -> logging.Logger: """Run this in your __main__ function.""" logging.basicConfig( - level=logging.DEBUG, + level=level, format="%(levelname)s: %(name)s: %(message)s", ) logging.addLevelName(logging.DEBUG, "dbug") @@ -28,6 +27,7 @@ def setup() -> None: handler = logging.StreamHandler() handler.setFormatter(formatter) logger.addHandler(handler) + return logger if __name__ == "__main__": |