Skip to content

Commit

Permalink
replace call to deprecated logging.fatal with logging.critical
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Aug 23, 2024
1 parent 269cc8a commit db5496f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion libvirtnbdbackup/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ def configLogger(
formatter = colorlog.ColoredFormatter(
logFormatColored,
datefmt=logDateFormat,
log_colors={"WARNING": "yellow", "ERROR": "red", "DEBUG": "cyan"},
log_colors={
"WARNING": "yellow",
"ERROR": "red",
"DEBUG": "cyan",
"CRITICAL": "red",
},
)
stderrh.setFormatter(formatter)
if args.quiet is False:
Expand Down
2 changes: 1 addition & 1 deletion libvirtnbdbackup/logcount.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ def __init__(self) -> None:
def emit(self, record: logging.LogRecord) -> None:
if record.levelno == logging.WARNING:
self.count.warnings += 1
if record.levelno == logging.ERROR:
if record.levelno in (logging.ERROR, logging.CRITICAL):
self.count.errors += 1
2 changes: 1 addition & 1 deletion virtnbdbackup
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def main() -> None:
except sshError as e:
logging.error("Remote Disk backup failed: [%s]", e)
except Exception as e: # pylint: disable=broad-except
logging.fatal("Unknown Exception during backup: %s", e)
logging.critical("Unknown Exception during backup: %s", e)
logging.exception(e)

if args.offline is False:
Expand Down

0 comments on commit db5496f

Please sign in to comment.