mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
Fixed logger format
This commit is contained in:
parent
3d501e9cb3
commit
eb39ec0a3d
1 changed files with 12 additions and 6 deletions
|
@ -131,8 +131,10 @@ class Utilities(Configs):
|
|||
yield package
|
||||
except FileNotFoundError:
|
||||
logger = logging.getLogger(LoggingConfig.date_time)
|
||||
logger.exception(f'{self.__class__.__name__}: '
|
||||
f'{self.__class__.read_packages_from_file.__name__}')
|
||||
logger.exception(
|
||||
f'{self.__class__.__name__}: '
|
||||
f'{self.__class__.read_packages_from_file.__name__}'
|
||||
)
|
||||
self.errors.raise_error_message(f"No such file or directory: '{file}'", exit_status=20)
|
||||
|
||||
def read_text_file(self, file: Path) -> list:
|
||||
|
@ -142,8 +144,10 @@ class Utilities(Configs):
|
|||
return text_file.readlines()
|
||||
except FileNotFoundError:
|
||||
logger = logging.getLogger(LoggingConfig.date_time)
|
||||
logger.exception(f'{self.__class__.__name__}: '
|
||||
f'{self.__class__.read_text_file.__name__}')
|
||||
logger.exception(
|
||||
f'{self.__class__.__name__}: '
|
||||
f'{self.__class__.read_text_file.__name__}'
|
||||
)
|
||||
self.errors.raise_error_message(f"No such file or directory: '{file}'", exit_status=20)
|
||||
|
||||
def process(self, command: str, stderr=None, stdout=None, filename=None) -> None:
|
||||
|
@ -159,8 +163,10 @@ class Utilities(Configs):
|
|||
output = subprocess.run(f'{command}{tee}', shell=True, stderr=stderr, stdout=stdout)
|
||||
except subprocess.CalledProcessError as error:
|
||||
logger = logging.getLogger(LoggingConfig.date_time)
|
||||
logger.exception(f'{self.__class__.__name__}'
|
||||
f'{self.__class__.process.__name__}')
|
||||
logger.exception(
|
||||
f'{self.__class__.__name__}'
|
||||
f'{self.__class__.process.__name__}'
|
||||
)
|
||||
self.errors.raise_error_message(str(error), exit_status=20)
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit(1)
|
||||
|
|
Loading…
Reference in a new issue