Skip to content

Commit

Permalink
Remove coloredlogs
Browse files Browse the repository at this point in the history
  • Loading branch information
darafferty committed Jun 14, 2024
1 parent c835da3 commit de69b9f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/compare_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import warnings

import astropy.io.fits
import coloredlogs
import numpy as np
import difflib

Expand Down Expand Up @@ -370,15 +369,20 @@ def init_logger(verbosity):
"""
global logger
logger = logging.getLogger()
fmt = "%(levelname)s [%(name)s]: %(message)s"

ch = logging.StreamHandler()
if verbosity == -1:
coloredlogs.install(fmt=fmt, level="ERROR")
ch.setLevel(logging.ERROR)
elif verbosity == 0:
coloredlogs.install(fmt=fmt, level="WARNING")
ch.setLevel(logging.WARNING)
elif verbosity == 1:
coloredlogs.install(fmt=fmt, level="INFO")
ch.setLevel(logging.INFO)
elif verbosity >= 2:
coloredlogs.install(fmt=fmt, level="DEBUG")
ch.setLevel(logging.DEBUG)

fmt = "%(levelname)s [%(name)s]: %(message)s"
ch.setFormatter(logging.Formatter(fmt))
logger.addHandler(ch)


def main(args):
Expand Down

0 comments on commit de69b9f

Please sign in to comment.