Skip to content

Commit 8fd7f23

Browse files
committed
Make simple
1 parent 3987726 commit 8fd7f23

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

library/utils.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1+
import logging
12
import threading
23
from typing import *
3-
import logging
4+
45

56
def fire_in_thread(f, *args, **kwargs):
67
threading.Thread(target=f, args=args, kwargs=kwargs).start()
78

9+
810
def setup_logging(log_level=logging.INFO):
911
if logging.root.handlers: # Already configured
1012
return
11-
try:
12-
from rich.logging import RichHandler
1313

14-
handler = RichHandler()
15-
except ImportError:
16-
handler = logging.StreamHandler()
14+
from rich.logging import RichHandler
1715

16+
handler = RichHandler()
1817
formatter = logging.Formatter(
19-
fmt="%(asctime)s %(levelname)s [%(name)s] %(message)s",
18+
fmt="%(message)s",
2019
datefmt="%Y-%m-%d %H:%M:%S",
2120
)
2221
handler.setFormatter(formatter)

0 commit comments

Comments
 (0)