diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-26 17:16:07 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-26 18:17:29 (GMT) |
commit | dab868b20b936add86967eafe32711413b80dd6e (patch) | |
tree | 60fa49f59a8de148bd3fad607f688851678bbde8 /commands | |
parent | 67d36d7eed2bf07063ba9cc7b3720f1efa4560ce (diff) |
Rework logging and output
Use the logs for all the commands output. Tail the log
if there is an error. Create a link to the latest log
so that buildbot can find it easily.
Diffstat (limited to 'commands')
-rwxr-xr-x | commands/build | 2 | ||||
-rw-r--r-- | commands/common.py | 8 | ||||
-rwxr-xr-x | commands/pull | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/commands/build b/commands/build index 0a8b2d4..38cae6b 100755 --- a/commands/build +++ b/commands/build @@ -13,7 +13,7 @@ parser.add_argument("module", nargs="?", help="name of the module to build") parser.add_argument("--full", action="store_true", help="force a full build") args = parser.parse_args() -common.setup() +common.setup(log_name="build") if not system.check(skip_if_unchanged=True): sys.exit(1) diff --git a/commands/common.py b/commands/common.py index e92f798..ac39daf 100644 --- a/commands/common.py +++ b/commands/common.py @@ -10,7 +10,7 @@ from devbot import command from devbot import git -def setup(): +def setup(log_name=None): git.set_root_path(base_dir) args = {"config_dir": os.path.join(base_dir, "config"), @@ -21,10 +21,10 @@ def setup(): "prefs_path": os.path.join(base_dir, "prefs"), "logs_dir": os.path.join(base_dir, "logs")} + if log_name: + args["log_name"] = log_name + if "SUGAR_BUILDBOT" in os.environ: args["relocatable"] = True config.setup(**args) - - tools_dir = os.path.join(base_dir, "tools") - command.set_logger(os.path.join(tools_dir, "log-command")) diff --git a/commands/pull b/commands/pull index 5989be6..cca1ff2 100755 --- a/commands/pull +++ b/commands/pull @@ -11,7 +11,7 @@ parser = argparse.ArgumentParser() parser.add_argument("module", nargs="?", help="name of the module to pull") args = parser.parse_args() -common.setup() +common.setup(log_name="pull") if args.module: success = build.pull_one(args.module) |