mirror of
https://github.com/archlinux-jerry/buildbot
synced 2024-11-22 13:00:40 +08:00
better logging
This commit is contained in:
parent
b96164fe93
commit
f23d480acb
1 changed files with 16 additions and 7 deletions
15
buildbot.py
15
buildbot.py
|
@ -500,7 +500,13 @@ updmgr = updateManager()
|
|||
|
||||
|
||||
|
||||
def info():
|
||||
def info(retf='human'):
|
||||
if retf == 'pkgconfigs':
|
||||
ret = jobsmgr.pkgconfigs
|
||||
elif retf == 'jobsmgr':
|
||||
ret = jobsmgr
|
||||
else:
|
||||
# retf = 'human'
|
||||
ret = str(jobsmgr)
|
||||
ret += '\nhuman-readable:\n'
|
||||
ret += "".join([f"{k} = {jobsmgr.jobs[k]}\n" for k in jobsmgr.jobs])
|
||||
|
@ -508,15 +514,19 @@ def info():
|
|||
return ret
|
||||
|
||||
def rebuild_package(pkgdirname, clean=False):
|
||||
logger.info(f'rebuild command accecpted for {pkgdirname}')
|
||||
return jobsmgr.rebuild_package(pkgdirname, clean=clean)
|
||||
|
||||
def clean(pkgdirname):
|
||||
logger.info(f'clean command accecpted for {pkgdirname}')
|
||||
return jobsmgr.reset_dir(pkgdirname=pkgdirname)
|
||||
|
||||
def clean_all():
|
||||
logger.info('clean command accecpted for all')
|
||||
return jobsmgr.reset_dir(all=True)
|
||||
|
||||
def force_upload(pkgdirname, overwrite=False):
|
||||
logger.info(f'force_upload command accecpted for {pkgdirname}')
|
||||
return jobsmgr.force_upload_package(pkgdirname, overwrite=overwrite)
|
||||
|
||||
def getup():
|
||||
|
@ -527,7 +537,7 @@ def run(funcname, args=list(), kwargs=dict()):
|
|||
'force_upload', 'getup'):
|
||||
logger.debug('running: %s %s %s',funcname, args, kwargs)
|
||||
ret = eval(funcname)(*args, **kwargs)
|
||||
logger.info('done: %s %s %s',funcname, args, kwargs)
|
||||
logger.debug('run: done: %s %s %s',funcname, args, kwargs)
|
||||
return ret
|
||||
else:
|
||||
logger.error('unexpected: %s %s %s',funcname, args, kwargs)
|
||||
|
@ -544,7 +554,6 @@ def __main():
|
|||
if type(myrecv) is list and len(myrecv) == 3:
|
||||
(funcname, args, kwargs) = myrecv
|
||||
funcname = str(funcname)
|
||||
logger.debug('running: %s %s %s', funcname, args, kwargs)
|
||||
conn.send(run(funcname, args=args, kwargs=kwargs))
|
||||
except Exception:
|
||||
print_exc_plus()
|
||||
|
|
Loading…
Reference in a new issue