Skip to content

Commit

Permalink
Simplified logging, v0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jcostom committed Jul 13, 2023
1 parent c16130f commit cdbaede
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions rollerblades.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
DEBUG = int(os.getenv('DEBUG', 0))

# --- Globals ---
VER = '0.8.3'
VER = '0.9'
USER_AGENT = f"rollerblades.py/{VER}"
KEY = 'CinemaTrailersPrerollID'

Expand All @@ -31,19 +31,11 @@
}

# Setup logger
LOG_LEVEL = 'DEBUG' if DEBUG else 'INFO'
logging.basicConfig(level=LOG_LEVEL,
format='[%(levelname)s] %(asctime)s %(message)s',
datefmt='[%d %b %Y %H:%M:%S %Z]')
logger = logging.getLogger()
ch = logging.StreamHandler()
if DEBUG:
logger.setLevel(logging.DEBUG)
ch.setLevel(logging.DEBUG)
else:
logger.setLevel(logging.INFO)
ch.setLevel(logging.INFO)

formatter = logging.Formatter('[%(levelname)s] %(asctime)s %(message)s',
datefmt='[%d %b %Y %H:%M:%S %Z]')
ch.setFormatter(formatter)
logger.addHandler(ch)


def load_prerolls(file: str) -> dict:
Expand Down

0 comments on commit cdbaede

Please sign in to comment.