From dab868b20b936add86967eafe32711413b80dd6e Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Wed, 26 Dec 2012 17:16:07 +0000 Subject: 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. --- (limited to 'commands') 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) -- cgit v0.9.1