At http://bazaar.launchpad.net/~jameinel/tarmac/logging
------------------------------------------------------------
revno: 125
revision-id: [email protected]
parent: [email protected]
committer: John Arbash Meinel <[email protected]>
branch nick: logging
timestamp: Thu 2009-07-09 11:25:29 -0500
message:
Add a bit more logging, and a --debug flag to print log messages to stderr.
=== modified file 'tarmac/bin.py'
--- a/tarmac/bin.py 2009-06-29 05:35:28 +0000
+++ b/tarmac/bin.py 2009-07-09 16:25:29 +0000
@@ -71,6 +71,10 @@
logging.basicConfig(filename=self.configuration.log_file,
level=logging.INFO)
self.logger = logging.getLogger('tarmac-lander')
+ if self.options.debug:
+ stderr_handler = logging.StreamHandler(sys.stderr)
+ stderr_handler.setLevel(logging.DEBUG)
+ self.logger.addHandler(stderr_handler)
# Write a pid file
if not test_mode:
@@ -91,6 +95,8 @@
parser.add_option('--test-command', type='string', default=None,
metavar='TEST',
help='The test command to run after merging a branch.')
+ parser.add_option('--debug', default=False, action='store_true',
+ help='Print information to the screen as well as logging.')
return parser
def _get_reviewers(self, candidate):
@@ -115,6 +121,8 @@
project = launchpad.projects[self.project]
try:
+ self.logger.info('Downloading development target:\n %s',
+ project.development_focus.branch)
trunk = Branch(project.development_focus.branch, create_tree=True)
except AttributeError:
message = (
@@ -125,12 +133,15 @@
print message
sys.exit()
+ self.logger.debug('Looking for landing candidates')
candidates = [entry for entry in trunk.landing_candidates
if entry.queue_status == u'Approved' and
entry.commit_message]
if not candidates:
self.logger.info('No branches approved to land.')
return
+ else:
+ self.logger.debug('Found %s candidates to land', len(candidates))
for candidate in candidates:
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits