Browse Source

[install] run with out rich (#513)

pull/514/head
Jiarui Fang 3 years ago committed by GitHub
parent
commit
81145208d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      colossalai/logging/logging.py

10
colossalai/logging/logging.py

@ -5,12 +5,16 @@ import colossalai
import logging
from pathlib import Path
from typing import Union
from rich.logging import RichHandler
from colossalai.context.parallel_mode import ParallelMode
_FORMAT = 'colossalai - %(name)s - %(asctime)s %(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=_FORMAT, handlers=[RichHandler()])
try:
from rich.logging import RichHandler
_FORMAT = 'colossalai - %(name)s - %(asctime)s %(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=_FORMAT, handlers=[RichHandler()])
except ImportError:
_FORMAT = 'colossalai - %(name)s - %(asctime)s %(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=_FORMAT)
class DistributedLogger:

Loading…
Cancel
Save