add seaman.sea_recorder
+ do_start argument logger=False disables info messages
This commit is contained in:
18
base.py
18
base.py
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user