Skip to content

Commit

Permalink
use logging_level config for asyncio debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
imanjra committed Apr 12, 2024
1 parent a746846 commit 1207d33
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fiftyone/server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| `voxel51.com <https://voxel51.com/>`_
|
"""

import argparse
import os

Expand All @@ -13,9 +14,6 @@
from hypercorn.config import Config
import logging

if os.environ.get("FIFTYONE_ENABLE_DEBUG_LOGGING", False):
logging.getLogger("asyncio").setLevel(logging.DEBUG)

if os.environ.get("FIFTYONE_DISABLE_SERVICES", False):
del os.environ["FIFTYONE_DISABLE_SERVICES"]

Expand All @@ -27,6 +25,10 @@
from fiftyone.server.app import app
from fiftyone.server.events import set_port

DEBUG_LOGGING = fo.config.logging_level == "DEBUG"

if DEBUG_LOGGING:
logging.getLogger("asyncio").setLevel(logging.DEBUG)

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand All @@ -45,4 +47,4 @@
if args.clean_start:
fo.delete_datasets("*")

asyncio.run(serve(app, config), debug=foc.DEV_INSTALL)
asyncio.run(serve(app, config), debug=DEBUG_LOGGING)

0 comments on commit 1207d33

Please sign in to comment.