Removed logging

This commit is contained in:
Dimitris Zlatanidis 2023-04-27 23:52:43 +03:00
parent 9f96ea26a2
commit 6a1e050790

View file

@ -1,13 +1,11 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
from pathlib import Path
from slpkg.configs import Configs
from slpkg.utilities import Utilities
from slpkg.repositories import Repositories
from slpkg.logging_config import LoggingConfig
from slpkg.models.models import session as Session
from slpkg.models.models import (SBoTable, PonceTable,
BinariesTable, LastRepoUpdated)
@ -21,11 +19,6 @@ class InstallData(Configs):
self.utils = Utilities()
self.repos = Repositories()
logging.basicConfig(filename=LoggingConfig.log_file,
filemode=LoggingConfig.filemode,
encoding=LoggingConfig.encoding,
level=LoggingConfig.level)
def last_updated(self, repo_file: Path) -> str:
""" Reads the first date of the changelog file."""
lines: list = self.utils.read_file(repo_file)
@ -131,9 +124,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_slack_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[2]):
@ -222,9 +212,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_slack_extra_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[2]):
@ -313,9 +300,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_slack_patches_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[2]):
@ -405,9 +389,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_alien_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -501,9 +482,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_multilib_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -592,9 +570,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_restricted_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -684,9 +659,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_gnome_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[2]):
@ -775,9 +747,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_msb_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -866,9 +835,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_csb_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -959,9 +925,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_conraid_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[2]):
@ -1051,9 +1014,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_slackonly_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -1148,9 +1108,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_salixos_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -1254,9 +1211,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_salixos_extra_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -1360,9 +1314,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_salixos_patches_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -1465,9 +1416,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_slackel_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):
@ -1570,9 +1518,6 @@ class InstallData(Configs):
try:
cache.append(checksums_dict[package_name])
except KeyError:
logger = logging.getLogger(LoggingConfig.date)
logger.exception('%s: %s:', self.__class__.__name__,
self.__class__.install_slint_data.__name__)
cache.append('error checksum')
if line.startswith(pkg_tag[1]):