jw.pkg.App: Remove .debug() and friends

Replace the jw.pkg.App.debug(), .warn() and .err() methods by the
global log() function. There's no obvious benefit in having App know
what's logged.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-01-25 15:18:27 +01:00
commit 95fa2f0d06
8 changed files with 39 additions and 41 deletions

View file

@ -2,6 +2,7 @@
from argparse import Namespace, ArgumentParser
from ...lib.log import *
from ..Cmd import Cmd
class CmdModules(Cmd): # export
@ -16,10 +17,10 @@ class CmdModules(Cmd): # export
def _run(self, args: Namespace) -> None:
import pathlib
proj_root = self.app.projs_root
self.app.debug("proj_root = " + proj_root)
log(DEBUG, "proj_root = " + proj_root)
path = pathlib.Path(self.app.projs_root)
modules = [p.parents[1].name for p in path.glob('*/make/project.conf')]
self.app.debug("modules = ", modules)
log(DEBUG, "modules = ", modules)
out = []
filters = None if args.filter is None else [re.split("=", f) for f in re.split(",", args.filter)]
for m in modules:
@ -33,7 +34,7 @@ class CmdModules(Cmd): # export
sec = None
key = path[0]
val = self.app.get_value(m, sec, key)
self.app.debug('Checking in {} if {}="{}", is "{}"'.format(m, f[0], f[1], val))
log(DEBUG, 'Checking in {} if {}="{}", is "{}"'.format(m, f[0], f[1], val))
if val and val == f[1]:
out.append(m)
break