"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "poetry/console/logging/io_handler.py" between
poetry-1.1.15.tar.gz and poetry-1.2.0.tar.gz

About: Poetry is a tool for dependency management and packaging in Python.

io_handler.py  (poetry-1.1.15):io_handler.py  (poetry-1.2.0)
from __future__ import annotations
import logging import logging
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from logging import LogRecord
from cleo.io.io import IO
class IOHandler(logging.Handler): class IOHandler(logging.Handler):
def __init__(self, io): def __init__(self, io: IO) -> None:
self._io = io self._io = io
super(IOHandler, self).__init__() super().__init__()
def emit(self, record): def emit(self, record: LogRecord) -> None:
try: try:
msg = self.format(record) msg = self.format(record)
level = record.levelname.lower() level = record.levelname.lower()
err = level in ("warning", "error", "exception", "critical") err = level in ("warning", "error", "exception", "critical")
if err: if err:
self._io.error_line(msg) self._io.write_error_line(msg)
else: else:
self._io.write_line(msg) self._io.write_line(msg)
except Exception: except Exception:
self.handleError(record) self.handleError(record)
 End of changes. 6 change blocks. 
4 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)