mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Added logging
This commit is contained in:
parent
795650e85a
commit
20f0aa105e
1 changed files with 10 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
from slpkg.checks import Check
|
||||
|
@ -26,6 +27,7 @@ from slpkg.binaries.install import Packages
|
|||
from slpkg.check_updates import CheckUpdates
|
||||
from slpkg.sbos.slackbuild import Slackbuilds
|
||||
from slpkg.binaries.queries import BinQueries
|
||||
from slpkg.logging_config import LoggingConfig
|
||||
from slpkg.find_installed import FindInstalled
|
||||
from slpkg.views.view_package import ViewPackage
|
||||
from slpkg.remove_packages import RemovePackages
|
||||
|
@ -283,6 +285,11 @@ class Argparse(Configs):
|
|||
self.check = Check(self.flags)
|
||||
self.check.is_blacklist(self.args[1:])
|
||||
|
||||
logging.basicConfig(filename=LoggingConfig.log_file,
|
||||
filemode='w',
|
||||
encoding='utf-8',
|
||||
level=logging.INFO)
|
||||
|
||||
def check_for_bin_repositories(self) -> None:
|
||||
""" Checks combination for binaries use repositories only and if repository exists. """
|
||||
if self.utils.is_option(self.flag_binaries, self.flags):
|
||||
|
@ -810,7 +817,9 @@ def main():
|
|||
|
||||
try:
|
||||
arguments[args[0]]()
|
||||
except (KeyError, IndexError):
|
||||
except (KeyError, IndexError) as err:
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.info('%s: %s', main.__name__, err)
|
||||
usage.help_short(1)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue