more straightforward logging
This commit is contained in:
@@ -15,16 +15,20 @@ OSM_CACHE_DIR = Path(cache_dir_string)
|
||||
|
||||
|
||||
import logging
|
||||
import yaml
|
||||
|
||||
LOGGING_CONFIG = LOCATION_PREFIX / 'log_config.yaml'
|
||||
config = yaml.safe_load(LOGGING_CONFIG.read_text())
|
||||
|
||||
logging.config.dictConfig(config)
|
||||
|
||||
# if we are in a debug session, set the log level to debug
|
||||
# if we are in a debug session, set verbose and rich logging
|
||||
if os.getenv('DEBUG', False):
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
from rich.logging import RichHandler
|
||||
logging.basicConfig(
|
||||
level=logging.DEBUG,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
handlers=[RichHandler()]
|
||||
)
|
||||
else:
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
)
|
||||
|
||||
|
||||
MEMCACHED_HOST_PATH = os.getenv('MEMCACHED_HOST_PATH', None)
|
||||
if MEMCACHED_HOST_PATH == "none":
|
||||
|
||||
Reference in New Issue
Block a user