[logging] expose file path

pull/2/head
Daniel Van Der Maden 5 years ago
parent 1b692a56b4
commit ae8b698996
  1. 2
      pyhmy/_version.py
  2. 4
      pyhmy/logging.py

@ -7,5 +7,5 @@ Provides pyhmy version information.
from incremental import Version from incremental import Version
__version__ = Version('pyhmy', 20, 1, 27) __version__ = Version('pyhmy', 20, 1, 29)
__all__ = ["__version__"] __all__ = ["__version__"]

@ -40,14 +40,14 @@ class ControlledLogger:
self.logger = logging.getLogger(logger_name) self.logger = logging.getLogger(logger_name)
self.logger.addHandler(handler) self.logger.addHandler(handler)
self._lock = threading.Lock() self._lock = threading.Lock()
self._file_dir = f"{log_dir}/{logger_name}.log" self.filepath = f"{log_dir}/{logger_name}.log"
self.info_buffer = [] self.info_buffer = []
self.debug_buffer = [] self.debug_buffer = []
self.warning_buffer = [] self.warning_buffer = []
self.error_buffer = [] self.error_buffer = []
def __repr__(self): def __repr__(self):
return f"<ControlledLogger @ {self._file_dir} : {self.logger}>" return f"<ControlledLogger @ {self.filepath} : {self.logger}>"
def _clear(self): def _clear(self):
""" """

Loading…
Cancel
Save