review loggers

This commit is contained in:
2022-06-19 22:28:31 +03:00
parent b8d2775050
commit 047925dcfe
11 changed files with 15 additions and 91 deletions

View File

@ -51,7 +51,7 @@ class Remote:
"""
default constructor
"""
self.logger = logging.getLogger("build_details")
self.logger = logging.getLogger("build")
@classmethod
def info(cls: Type[Remote], package_name: str, *, pacman: Pacman) -> AURPackage:

View File

@ -50,7 +50,7 @@ class Repo:
paths(RepositoryPaths): repository paths instance
sign_args(List[str]): additional args which have to be used to sign repository archive
"""
self.logger = logging.getLogger("build_details")
self.logger = logging.getLogger("build")
self.name = name
self.paths = paths
self.uid, _ = paths.root_owner

View File

@ -40,7 +40,7 @@ class Sources:
"""
DEFAULT_BRANCH = "master" # default fallback branch
logger = logging.getLogger("build_details")
logger = logging.getLogger("build")
_check_output = check_output

View File

@ -36,7 +36,6 @@ class Task:
base package build task
Attributes:
build_logger(logging.Logger): logger for build process
logger(logging.Logger): class logger
package(Package): package definitions
paths(RepositoryPaths): repository paths instance
@ -54,8 +53,7 @@ class Task:
configuration(Configuration): configuration instance
paths(RepositoryPaths): repository paths instance
"""
self.logger = logging.getLogger("root")
self.build_logger = logging.getLogger("build_details")
self.logger = logging.getLogger("build")
self.package = package
self.paths = paths
self.uid, _ = paths.root_owner
@ -85,14 +83,14 @@ class Task:
*command,
exception=BuildFailed(self.package.base),
cwd=sources_dir,
logger=self.build_logger,
logger=self.logger,
user=self.uid)
# well it is not actually correct, but we can deal with it
packages = Task._check_output("makepkg", "--packagelist",
exception=BuildFailed(self.package.base),
cwd=sources_dir,
logger=self.build_logger).splitlines()
logger=self.logger).splitlines()
return [Path(package) for package in packages]
def init(self, sources_dir: Path, database: SQLite) -> None:

View File

@ -54,7 +54,7 @@ class Migrations:
"""
self.connection = connection
self.configuration = configuration
self.logger = logging.getLogger("database")
self.logger = logging.getLogger("root")
@classmethod
def migrate(cls: Type[Migrations], connection: Connection, configuration: Configuration) -> MigrationResult:

View File

@ -45,7 +45,7 @@ class Operations:
path(Path): path to the database file
"""
self.path = path
self.logger = logging.getLogger("database")
self.logger = logging.getLogger("root")
@staticmethod
def factory(cursor: Cursor, row: Tuple[Any, ...]) -> Dict[str, Any]:

View File

@ -51,7 +51,7 @@ class GPG:
architecture(str): repository architecture
configuration(Configuration): configuration instance
"""
self.logger = logging.getLogger("build_details")
self.logger = logging.getLogger("build")
self.architecture = architecture
self.configuration = configuration
self.targets, self.default_key = self.sign_options(configuration)

View File

@ -281,7 +281,7 @@ class Package:
from ahriman.core.build_tools.sources import Sources
logger = logging.getLogger("build_details")
logger = logging.getLogger("build")
Sources.load(paths.cache_for(self.base), self, None, paths)
try: