import argparse
import ast
import json
+import logging
import os
import re
import readline
from qemu.qmp import QMPMessage
+LOG = logging.getLogger(__name__)
+
+
class QMPCompleter:
# NB: Python 3.9+ will probably allow us to subclass list[str] directly,
# but pylint as of today does not know that List[str] is simply 'list'.
except FileNotFoundError:
pass
except IOError as err:
- print(f"Failed to read history '{self._histfile}': {err!s}")
+ msg = f"Failed to read history '{self._histfile}': {err!s}"
+ LOG.warning(msg)
def _save_history(self) -> None:
try:
readline.write_history_file(self._histfile)
except IOError as err:
- print(f"Failed to save history file '{self._histfile}': {err!s}")
+ msg = f"Failed to save history file '{self._histfile}': {err!s}"
+ LOG.warning(msg)
@classmethod
def __parse_value(cls, val: str) -> object: