Added logging path

This commit is contained in:
Dimitris Zlatanidis 2023-04-05 21:34:25 +03:00
parent 33c6d676c2
commit 428f37b151
2 changed files with 4 additions and 1 deletions

View file

@ -46,6 +46,8 @@ class Configs:
}
prog_name: str = 'slpkg'
root_slpkg: Path = Path(Path.home(), f'.{prog_name}')
log_path: Path = Path(root_slpkg, 'logs')
os_arch: str = platform.machine()
tmp_path: str = '/tmp/'
tmp_slpkg: Path = Path(tmp_path, prog_name)
@ -114,6 +116,7 @@ class Configs:
# Creating the paths if not exists
paths = [
tmp_slpkg,
log_path,
build_path,
download_only_path,
lib_path,

View file

@ -24,7 +24,7 @@ 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='slpkg_upgrade.log', encoding='utf-8', level=logging.DEBUG)
logging.basicConfig(filename=f'{self.log_path}/slpkg_upgrade.log', encoding='utf-8', level=logging.DEBUG)
def packages(self) -> Generator[str, None, None]:
""" Returns the upgradable packages. """