diff --git a/qupsy/spec.py b/qupsy/spec.py index c4e769e..3109e6b 100644 --- a/qupsy/spec.py +++ b/qupsy/spec.py @@ -37,12 +37,15 @@ def __str__(self) -> str: testcases_string.append( f" ( Input: {input_str},\n Output: {output_str})," ) - return f"""Spec( - gates: [{", ".join(map(lambda g: g.__name__, self.gates))}], + return """Spec( + gates: [{}], testcases: [ -{"\n".join(testcases_string)} +{} ], -)""" +)""".format( + ", ".join(map(lambda g: g.__name__, self.gates)), + "\n".join(testcases_string), + ) def make_spec(data: SpecData) -> Spec: diff --git a/qupsy/utils.py b/qupsy/utils.py index ed31bb2..3efa873 100644 --- a/qupsy/utils.py +++ b/qupsy/utils.py @@ -1,26 +1,10 @@ import logging -import os from rich.console import Console from rich.logging import RichHandler console = Console() - - -_log_level = os.environ.get("LOG_LEVEL") -if _log_level is not None: - _log_level = _log_level.upper() - _log_level = logging.getLevelNamesMapping()[_log_level] - - -_hander = RichHandler( - console=console, - show_path=_log_level is not None and _log_level == logging.DEBUG, -) - +_hander = RichHandler(console=console, show_path=False) _hander.setFormatter(logging.Formatter(fmt="%(message)s", datefmt="[%X]")) - logger = logging.getLogger("quspy") logger.addHandler(_hander) -if _log_level is not None: - logger.setLevel(_log_level)