Skip to content

Commit

Permalink
Added output parameter to log() method (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
sevketcaba authored Nov 1, 2023
1 parent 0dd13e6 commit 91e5956
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/uglylogger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ def log(
msg: typing.Any,
color: LogColor | None = None,
level: LogLevel = LogLevel.DEBUG,
output: LogOutput = LogOutput.ALL,
):
"""Logs both to the file and to the console
Expand All @@ -416,9 +417,12 @@ def log(
color (LogColor | None, optional): Color to overwrite,
otherwise uses color by the LogLevel. Defaults to None.
level (LogLevel, optional): Defaults to LogLevel.DEBUG.
output (LogOutput, optional): Defaults to LogOutput.ALL.
"""
self.console(msg, color, level)
self.file(msg, level)
if LogOutput.CONSOLE in output:
self.console(msg, color, level)
if LogOutput.FILE in output:
self.file(msg, level)

def debug(
self,
Expand Down

0 comments on commit 91e5956

Please sign in to comment.