mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Updated logging
This commit is contained in:
parent
428f37b151
commit
bd69f9be4e
1 changed files with 7 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Generator
|
||||
from packaging.version import parse, InvalidVersion
|
||||
|
||||
|
@ -24,7 +25,11 @@ class Upgrade(Configs):
|
|||
self.repo_for_binaries: bool = self.utils.is_option(self.flag_bin_repository, self.flags)
|
||||
|
||||
self.all_installed: list = self.utils.installed_package_names
|
||||
logging.basicConfig(filename=f'{self.log_path}/slpkg_upgrade.log', encoding='utf-8', level=logging.DEBUG)
|
||||
|
||||
log_file: Path = Path(self.log_path, 'debug_upgrade.log')
|
||||
logging.basicConfig(filename=log_file,
|
||||
encoding='utf-8',
|
||||
level=logging.DEBUG)
|
||||
|
||||
def packages(self) -> Generator[str, None, None]:
|
||||
""" Returns the upgradable packages. """
|
||||
|
@ -67,6 +72,6 @@ class Upgrade(Configs):
|
|||
if parse(repo_version) == parse(inst_version) and parse(repo_build) > parse(inst_build):
|
||||
return True
|
||||
except InvalidVersion as err:
|
||||
logging.debug(err)
|
||||
logging.error(err)
|
||||
|
||||
return False
|
||||
|
|
Loading…
Add table
Reference in a new issue