Skip to content

Commit

Permalink
Fix NoxColoredFormatter.format (#374)
Browse files Browse the repository at this point in the history
That method is making use of `_simple_fmt`,
but isn't defined in the class.
I used the same value as `NoxFormatter`
  • Loading branch information
stsewd authored Dec 31, 2020
1 parent 4d42022 commit 6f23914
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nox/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(
reset=reset,
secondary_log_colors=secondary_log_colors,
)
self._simple_fmt = logging.Formatter("%(message)s")

def format(self, record: Any) -> str:
if record.levelname == "OUTPUT":
Expand All @@ -72,7 +73,7 @@ def format(self, record: Any) -> str:

class LoggerWithSuccessAndOutput(logging.getLoggerClass()): # type: ignore
def __init__(self, name: str, level: int = logging.NOTSET):
super(LoggerWithSuccessAndOutput, self).__init__(name, level)
super().__init__(name, level)
logging.addLevelName(SUCCESS, "SUCCESS")
logging.addLevelName(OUTPUT, "OUTPUT")

Expand Down

0 comments on commit 6f23914

Please sign in to comment.