add seaman.sea_recorder

+ do_start argument logger=False disables info messages
This commit is contained in:
2025-06-17 11:05:11 +02:00
parent bcb3a64f8c
commit d235f6d35f
2 changed files with 31 additions and 7 deletions

18
base.py
View File

@@ -310,15 +310,21 @@ class ServiceManager:
ins_list = self.wildcard(ins)
if ins_list is not None:
return ins_list
if logger is None:
class logger:
@staticmethod
if not logger:
if logger is False:
def info(fmt, *args):
pass
else:
def info(fmt, *args):
print(fmt % args)
@staticmethod
def error(fmt, *args):
print(('ERROR: ' + fmt) % args)
def error(fmt, *args):
print(('ERROR: ' + fmt) % args)
logger = type('Logger', (), {})
logger.info = info
logger.error = error
if ins is None:
logger.info('nothing to start')