Switching to self-contained binary -
initial commit.
This commit is contained in:
21
config.py
21
config.py
@@ -1,24 +1,7 @@
|
||||
import logging, os, sys
|
||||
|
||||
import os
|
||||
# Main config section
|
||||
class Config:
|
||||
APP_NAME = "hydrogen"
|
||||
MAIN_PAGE_TITLE = "Selected poems"
|
||||
OUTPUT_DIR = os.environ.get('OUTPUT_DIR') or 'public'
|
||||
HEADER_IMAGE = 'static/header.jpg'
|
||||
LOG_TO = sys.stdout
|
||||
LOG_LEVEL = logging.DEBUG
|
||||
|
||||
# Logging config section
|
||||
logger = logging.getLogger(Config.APP_NAME)
|
||||
logger.setLevel(Config.LOG_LEVEL)
|
||||
stdout_handler = logging.StreamHandler(Config.LOG_TO)
|
||||
stdout_handler.setLevel(Config.LOG_LEVEL)
|
||||
formatter = logging.Formatter(
|
||||
'[%(asctime)s] %(name)s: %(levelname)s: %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S'
|
||||
)
|
||||
stdout_handler.setFormatter(formatter)
|
||||
if not logger.hasHandlers():
|
||||
logger.addHandler(stdout_handler)
|
||||
logger.propagate = False
|
||||
HEADER_IMAGE = 'static/header.jpg'
|
||||
Reference in New Issue
Block a user