diff --git a/bugwarrior/command.py b/bugwarrior/command.py index e40424654..2ffa5a6f0 100644 --- a/bugwarrior/command.py +++ b/bugwarrior/command.py @@ -1,10 +1,8 @@ import os -from twiggy import log from lockfile import LockTimeout from lockfile.pidlockfile import PIDLockFile -import twiggy import getpass import keyring import click @@ -16,6 +14,9 @@ synchronize, ) +import logging +log = logging.getLogger(__name__) + # We overwrite 'list' further down. lst = list @@ -37,7 +38,7 @@ def pull(dry_run, flavor, interactive, debug): Relies on configuration in bugwarriorrc """ - twiggy.quickSetup() + try: main_section = _get_section_name(flavor) @@ -56,7 +57,7 @@ def pull(dry_run, flavor, interactive, debug): finally: lockfile.release() except LockTimeout: - log.name('command').critical( + log.critical( 'Your taskrc repository is currently locked. ' 'Remove the file at %s if you are sure no other ' 'bugwarrior processes are currently running.' % ( @@ -64,9 +65,9 @@ def pull(dry_run, flavor, interactive, debug): ) ) except RuntimeError as e: - log.name('command').critical("Aborted (%s)" % e) + log.critical("Aborted (%s)" % e) except: - log.name('command').trace('error').critical('oh noes') + log.exception('oh noes') @click.group() diff --git a/bugwarrior/config.py b/bugwarrior/config.py index b61b3f639..c122eb12d 100644 --- a/bugwarrior/config.py +++ b/bugwarrior/config.py @@ -5,11 +5,11 @@ import sys import six -import twiggy -from twiggy import log -from twiggy.levels import name2level from xdg import BaseDirectory +import logging +log = logging.getLogger(__name__) + def asbool(some_value): """ Cast config values to boolean. """ @@ -90,16 +90,16 @@ def load_example_rc(): error_template = """ ************************************************* * There was a problem with your bugwarriorrc * -* {msg} +* {error_msg} * Here's an example template to help: * ************************************************* {example}""" -def die(msg): - log.options(suppress_newlines=False).critical( +def die(error_msg): + log.critical( error_template, - msg=msg, + error_msg=error_msg, example=load_example_rc(), ) sys.exit(1) @@ -109,11 +109,22 @@ def validate_config(config, main_section): if not config.has_section(main_section): die("No [%s] section found." % main_section) - twiggy.quickSetup( - name2level(config.get(main_section, 'log.level')), - config.get(main_section, 'log.file') + logging.basicConfig( + level=getattr(logging, config.get(main_section, 'log.level')), + filename=config.get(main_section, 'log.file'), ) + # In general, its nice to log "everything", but some of the loggers from + # our dependencies are very very spammy. Here, we silence most of their + # noise: + spammers = [ + 'bugzilla.base', + 'bugzilla.bug', + 'requests.packages.urllib3.connectionpool', + ] + for spammer in spammers: + logging.getLogger(spammer).setLevel(logging.WARN) + if not config.has_option(main_section, 'targets'): die("No targets= item in [%s] found." % main_section) @@ -141,7 +152,7 @@ def validate_config(config, main_section): def load_config(main_section, interactive=False): - config = ConfigParser({'log.level': "DEBUG", 'log.file': None}) + config = ConfigParser({'log.level': "INFO", 'log.file': None}) path = None first_path = BaseDirectory.load_first_config('bugwarrior') if first_path is not None: diff --git a/bugwarrior/db.py b/bugwarrior/db.py index 3ba0c4338..98fe43f71 100644 --- a/bugwarrior/db.py +++ b/bugwarrior/db.py @@ -8,13 +8,15 @@ import requests import dogpile.cache import six -from twiggy import log from taskw import TaskWarriorShellout from taskw.exceptions import TaskwarriorError from bugwarrior.config import asbool, get_taskrc_path from bugwarrior.notifications import send_notification +import logging +log = logging.getLogger(__name__) + MARKUP = "(bw)" @@ -66,17 +68,6 @@ def get_normalized_annotation(annotation): ) -def sanitize(string): - """ Sanitize a string for logging with twiggy. - - It is obnoxious that we have to do this ourselves, but twiggy doesn't like - strings with non-ascii characters or with curly braces in them. - """ - if not isinstance(string, six.string_types): - return string - return six.text_type(string.replace('{', '{{').replace('}', '}}')) - - def get_annotation_hamming_distance(left, right): left = get_normalized_annotation(left) right = get_normalized_annotation(right) @@ -256,19 +247,12 @@ def merge_left(field, local_task, remote_issue, hamming=False): found = True break if not found: - log.name('db').debug( - "%s not found in %r" % (remote, local_field) - ) + log.debug("%s not found in %r" % (remote, local_field)) local_task[field].append(remote) new_count += 1 if new_count > 0: - log.name('db').debug( - 'Added %s new values to %s (total: %s)' % ( - new_count, - field, - len(local_task[field]), - ) - ) + log.debug('Added %s new values to %s (total: %s)' % ( + new_count, field, len(local_task[field]),)) def run_hooks(conf, name): @@ -283,7 +267,7 @@ def run_hooks(conf, name): msg = 'Non-zero exit code %d on hook %s' % ( exit_code, hook ) - log.name('hooks:%s' % name).error(msg) + log.error(msg) raise RuntimeError(msg) @@ -300,7 +284,7 @@ def _bool_option(section, option, default): uda_list = build_uda_config_overrides(services) if uda_list: - log.name('bugwarrior').info( + log.info( 'Service-defined UDAs exist: you can optionally use the ' '`bugwarrior-uda` command to export a list of UDAs you can ' 'add to your ~/.taskrc file.' @@ -366,20 +350,16 @@ def _bool_option(section, option, default): issue_updates['closed'].remove(existing_uuid) except MultipleMatches as e: - log.name('db').error("Multiple matches: {0}", six.text_type(e)) - log.name('db').trace(e) + log.exception("Multiple matches: %s", six.text_type(e)) except NotFound: issue_updates['new'].append(dict(issue)) notreally = ' (not really)' if dry_run else '' # Add new issues - log.name('db').info("Adding {0} tasks", len(issue_updates['new'])) + log.info("Adding %i tasks", len(issue_updates['new'])) for issue in issue_updates['new']: - log.name('db').info( - "Adding task {0}{1}", - issue['description'].encode("utf-8"), - notreally - ) + log.info("Adding task %s%s", + issue['description'].encode("utf-8"), notreally) if dry_run: continue if notify: @@ -388,10 +368,9 @@ def _bool_option(section, option, default): try: tw.task_add(**issue) except TaskwarriorError as e: - log.name('db').error("Unable to add task: %s" % e.stderr) - log.name('db').trace(e) + log.exception("Unable to add task: %s" % e.stderr) - log.name('db').info("Updating {0} tasks", len(issue_updates['changed'])) + log.info("Updating %i tasks", len(issue_updates['changed'])) for issue in issue_updates['changed']: changes = '; '.join([ '{field}: {f} -> {t}'.format( @@ -401,8 +380,8 @@ def _bool_option(section, option, default): ) for field, ch in six.iteritems(issue.get_changes(keep=True)) ]) - log.name('db').info( - "Updating task {0}, {1}; {2}{3}", + log.info( + "Updating task %s, %s; %s%s", six.text_type(issue['uuid']).encode("utf-8"), issue['description'].encode("utf-8"), changes, @@ -414,14 +393,13 @@ def _bool_option(section, option, default): try: tw.task_update(issue) except TaskwarriorError as e: - log.name('db').error("Unable to modify task: %s" % e.stderr) - log.name('db').trace(e) + log.exception("Unable to modify task: %s" % e.stderr) - log.name('db').info("Closing {0} tasks", len(issue_updates['closed'])) + log.info("Closing %i tasks", len(issue_updates['closed'])) for issue in issue_updates['closed']: _, task_info = tw.get_task(uuid=issue) - log.name('db').info( - "Completing task {0} {1}{2}", + log.info( + "Completing task %s %s%s", issue, task_info.get('description', '').encode('utf-8'), notreally @@ -435,8 +413,7 @@ def _bool_option(section, option, default): try: tw.task_done(uuid=issue) except TaskwarriorError as e: - log.name('db').error("Unable to close task: %s" % e.stderr) - log.name('db').trace(e) + log.exception("Unable to close task: %s" % e.stderr) # Send notifications if notify: diff --git a/bugwarrior/services/__init__.py b/bugwarrior/services/__init__.py index 7743da8d7..768f0c3d0 100644 --- a/bugwarrior/services/__init__.py +++ b/bugwarrior/services/__init__.py @@ -11,13 +11,15 @@ from jinja2 import Template import pytz import six -from twiggy import log from taskw.task import Task from bugwarrior.config import asbool, die, get_service_password from bugwarrior.db import MARKUP, URLShortener +import logging +log = logging.getLogger(__name__) + # Sentinels for process completion status SERVICE_FINISHED_OK = 0 @@ -90,7 +92,7 @@ def __init__(self, config, main_section, target): if config.has_option(self.target, 'default_priority'): self.default_priority = config.get(self.target, 'default_priority') - log.name(target).info("Working on [{0}]", self.target) + log.info("Working on [%s]", self.target) def get_templates(self): """ Get any defined templates for configuration values. @@ -514,34 +516,28 @@ def _aggregate_issues(conf, main_section, target, queue, service_name): queue.put(issue) issue_count += 1 except SystemExit as e: - log.name(target).critical(str(e)) + log.critical(str(e)) queue.put((SERVICE_FINISHED_ERROR, (target, e))) except BaseException as e: - log.name(target).trace('error').critical( - "Worker for [%s] failed: %s" % (target, e) - ) - queue.put( - (SERVICE_FINISHED_ERROR, (target, e)) - ) + log.exception("Worker for [%s] failed: %s" % (target, e)) + queue.put((SERVICE_FINISHED_ERROR, (target, e))) else: - queue.put( - (SERVICE_FINISHED_OK, (target, issue_count, )) - ) + queue.put((SERVICE_FINISHED_OK, (target, issue_count, ))) finally: duration = time.time() - start - log.name(target).info("Done with [%s] in %fs" % (target, duration)) + log.info("Done with [%s] in %fs" % (target, duration)) def aggregate_issues(conf, main_section, debug): """ Return all issues from every target. """ - log.name('bugwarrior').info("Starting to aggregate remote issues.") + log.info("Starting to aggregate remote issues.") # Create and call service objects for every target in the config targets = [t.strip() for t in conf.get(main_section, 'targets').split(',')] queue = multiprocessing.Queue() - log.name('bugwarrior').info("Spawning %i workers." % len(targets)) + log.info("Spawning %i workers." % len(targets)) processes = [] if debug: @@ -575,7 +571,7 @@ def aggregate_issues(conf, main_section, debug): completion_type, args = issue if completion_type == SERVICE_FINISHED_ERROR: target, e = args - log.name('bugwarrior').info("Terminating workers") + log.info("Terminating workers") for process in processes: process.terminate() raise RuntimeError( @@ -584,4 +580,4 @@ def aggregate_issues(conf, main_section, debug): continue yield issue - log.name('bugwarrior').info("Done aggregating remote issues.") + log.info("Done aggregating remote issues.") diff --git a/bugwarrior/services/activecollab.py b/bugwarrior/services/activecollab.py index bb089a73c..a614e07d3 100644 --- a/bugwarrior/services/activecollab.py +++ b/bugwarrior/services/activecollab.py @@ -1,11 +1,13 @@ import re import pypandoc -from twiggy import log from pyac.library import activeCollab from bugwarrior.services import IssueService, Issue from bugwarrior.config import die +import logging +log = logging.getLogger(__name__) + class ActiveCollabClient(object): def __init__(self, url, key, user_id): @@ -242,8 +244,8 @@ def issues(self): subtask['task_id'] = task['task_id'] subtask['milestone'] = task['milestone'] issues.append(subtask) - log.name(self.target).debug(" Found {0} total", task_count) - log.name(self.target).debug(" Pruned down to {0}", len(issues)) + log.debug(" Found %i total", task_count) + log.debug(" Pruned down to %i", len(issues)) for issue in issues: issue_obj = self.get_issue_for_record(issue) extra = { diff --git a/bugwarrior/services/activecollab2.py b/bugwarrior/services/activecollab2.py index 7dc69012c..3efcba2a5 100644 --- a/bugwarrior/services/activecollab2.py +++ b/bugwarrior/services/activecollab2.py @@ -3,11 +3,13 @@ import six import requests -from twiggy import log from bugwarrior.services import IssueService, Issue, ServiceClient from bugwarrior.config import die +import logging +log = logging.getLogger(__name__) + class ActiveCollab2Client(ServiceClient): def __init__(self, url, key, user_id, projects, target): @@ -60,7 +62,7 @@ def get_issue_generator(self, user_id, project_id, project_name): assigned_task = self.get_task_dict(project_id, key, task) if assigned_task: - log.name(self.target).debug( + log.debug( " Adding '" + assigned_task['description'] + "' to task list.") yield assigned_task @@ -207,7 +209,7 @@ def issues(self): projects = self.projects for project in projects: for project_id, project_name in project.iteritems(): - log.name(self.target).debug( + log.debug( " Getting tasks for #" + project_id + " " + project_name + '"') issue_generators.append( @@ -216,8 +218,7 @@ def issues(self): ) ) - log.name(self.target).debug( - " Elapsed Time: %s" % (time.time() - start)) + log.debug(" Elapsed Time: %s" % (time.time() - start)) for record in itertools.chain(*issue_generators): yield self.get_issue_for_record(record) diff --git a/bugwarrior/services/bitbucket.py b/bugwarrior/services/bitbucket.py index d8e3e9054..283e50587 100644 --- a/bugwarrior/services/bitbucket.py +++ b/bugwarrior/services/bitbucket.py @@ -1,12 +1,13 @@ from __future__ import unicode_literals import requests -from twiggy import log from bugwarrior import data from bugwarrior.services import IssueService, Issue, ServiceClient from bugwarrior.config import asbool, die +import logging +log = logging.getLogger(__name__) class BitbucketIssue(Issue): TITLE = 'bitbuckettitle' @@ -215,7 +216,7 @@ def issues(self): ]) issues = sum([self.fetch_issues(repo) for repo in repo_tags], []) - log.name(self.target).debug(" Found {0} total.", len(issues)) + log.debug(" Found %i total.", len(issues)) closed = ['resolved', 'duplicate', 'wontfix', 'invalid', 'closed'] try: @@ -223,7 +224,7 @@ def issues(self): except KeyError: # Undocumented API change. issues = filter(lambda tup: tup[1]['state'] not in closed, issues) issues = filter(self.include, issues) - log.name(self.target).debug(" Pruned down to {0}", len(issues)) + log.debug(" Pruned down to %i", len(issues)) for tag, issue in issues: issue_obj = self.get_issue_for_record(issue) @@ -239,13 +240,13 @@ def issues(self): if not self.filter_merge_requests: pull_requests = sum( [self.fetch_pull_requests(repo) for repo in repo_tags], []) - log.name(self.target).debug(" Found {0} total.", len(pull_requests)) + log.debug(" Found %i total.", len(pull_requests)) closed = ['rejected', 'fulfilled'] not_resolved = lambda tup: tup[1]['state'] not in closed pull_requests = filter(not_resolved, pull_requests) pull_requests = filter(self.include, pull_requests) - log.name(self.target).debug(" Pruned down to {0}", len(pull_requests)) + log.debug(" Pruned down to %i", len(pull_requests)) for tag, issue in pull_requests: issue_obj = self.get_issue_for_record(issue) diff --git a/bugwarrior/services/bz.py b/bugwarrior/services/bz.py index 8f316cf54..5cbca85c0 100644 --- a/bugwarrior/services/bz.py +++ b/bugwarrior/services/bz.py @@ -1,5 +1,4 @@ import bugzilla -from twiggy import log import time import pytz @@ -9,6 +8,9 @@ from bugwarrior.config import die, asbool from bugwarrior.services import IssueService, Issue +import logging +log = logging.getLogger(__name__) + class BugzillaIssue(Issue): URL = 'bugzillaurl' @@ -113,7 +115,7 @@ def __init__(self, *args, **kw): 'include_needinfos', False, to_type=lambda x: x == "True") self.open_statuses = self.config_get_default( 'open_statuses', _open_statuses, to_type=lambda x: x.split(',')) - log.name(self.target).debug(" filtering on statuses: {0}", self.open_statuses) + log.debug(" filtering on statuses: %r", self.open_statuses) # So more modern bugzilla's require that we specify # query_format=advanced along with the xmlrpc request. @@ -235,7 +237,7 @@ def issues(self): ] issues = [(self.target, bug) for bug in bugs] - log.name(self.target).debug(" Found {0} total.", len(issues)) + log.debug(" Found %i total.", len(issues)) # Build a url for each issue base_url = "https://%s/show_bug.cgi?id=" % (self.base_uri) diff --git a/bugwarrior/services/github.py b/bugwarrior/services/github.py index 617b7cd43..42c7e3208 100644 --- a/bugwarrior/services/github.py +++ b/bugwarrior/services/github.py @@ -3,11 +3,13 @@ import requests from jinja2 import Template -from twiggy import log from bugwarrior.config import asbool, die from bugwarrior.services import IssueService, Issue, ServiceClient +import logging +log = logging.getLogger(__name__) + class GithubClient(ServiceClient): def __init__(self, auth): @@ -284,7 +286,7 @@ def get_involved_issues(self, user): url = issue['html_url'] tag = re.match('.*github\\.com/(.*)/(issues|pull)/[^/]*$', url) if tag is None: - log.name(self.target).critical(" Unrecognized issue URL: {0}.", url) + log.critical(" Unrecognized issue URL: %s.", url) continue issues[url] = (tag.group(1), issue) return issues @@ -313,7 +315,7 @@ def annotations(self, tag, issue, issue_obj): annotations = [] if self.annotation_comments: comments = self._comments(tag, issue['number']) - log.name(self.target).debug(" got comments for {0}", issue['html_url']) + log.debug(" got comments for %s", issue['html_url']) annotations = (( c['user']['login'], c['body'], @@ -373,9 +375,9 @@ def issues(self): ) if self.config_get_default('include_user_issues', True, asbool): issues.update(self.get_directly_assigned_issues()) - log.name(self.target).debug(" Found {0} issues.", len(issues)) + log.debug(" Found %i issues.", len(issues)) issues = filter(self.include, issues.values()) - log.name(self.target).debug(" Pruned down to {0} issues.", len(issues)) + log.debug(" Pruned down to %i issues.", len(issues)) for tag, issue in issues: # Stuff this value into the upstream dict for: diff --git a/bugwarrior/services/gitlab.py b/bugwarrior/services/gitlab.py index 4974b64ce..0911ee32b 100644 --- a/bugwarrior/services/gitlab.py +++ b/bugwarrior/services/gitlab.py @@ -4,11 +4,13 @@ import six from jinja2 import Template -from twiggy import log from bugwarrior.config import asbool, die from bugwarrior.services import IssueService, Issue, ServiceClient +import logging +log = logging.getLogger(__name__) + class GitlabIssue(Issue): TITLE = 'gitlabtitle' @@ -354,9 +356,9 @@ def issues(self): issues.update( self.get_repo_issues(rid) ) - log.name(self.target).debug(" Found {0} issues.", len(issues)) + log.debug(" Found %i issues.", len(issues)) issues = filter(self.include, issues.values()) - log.name(self.target).debug(" Pruned down to {0} issues.", len(issues)) + log.debug(" Pruned down to %i issues.", len(issues)) for rid, issue in issues: repo = repo_map[rid] @@ -380,9 +382,9 @@ def issues(self): merge_requests.update( self.get_repo_merge_requests(rid) ) - log.name(self.target).debug(" Found {0} merge requests.", len(merge_requests)) + log.debug(" Found %i merge requests.", len(merge_requests)) merge_requests = filter(self.include, merge_requests.values()) - log.name(self.target).debug(" Pruned down to {0} merge requests.", len(merge_requests)) + log.debug(" Pruned down to %i merge requests.", len(merge_requests)) for rid, issue in merge_requests: repo = repo_map[rid] diff --git a/bugwarrior/services/mplan.py b/bugwarrior/services/mplan.py index da58c388e..1ac2648a5 100644 --- a/bugwarrior/services/mplan.py +++ b/bugwarrior/services/mplan.py @@ -1,11 +1,13 @@ from __future__ import absolute_import import megaplan -from twiggy import log from bugwarrior.config import die from bugwarrior.services import IssueService, Issue +import logging +log = logging.getLogger(__name__) + class MegaplanIssue(Issue): URL = 'megaplanurl' @@ -104,7 +106,7 @@ def validate_config(cls, config, target): def issues(self): issues = self.client.get_actual_tasks() - log.name(self.target).debug(" Found {0} total.", len(issues)) + log.debug(" Found %i total.", len(issues)) for issue in issues: yield self.get_issue_for_record(issue) diff --git a/bugwarrior/services/pagure.py b/bugwarrior/services/pagure.py index 1e4c8d499..117be0056 100644 --- a/bugwarrior/services/pagure.py +++ b/bugwarrior/services/pagure.py @@ -6,11 +6,14 @@ import requests from jinja2 import Template -from twiggy import log from bugwarrior.config import asbool, die from bugwarrior.services import IssueService, Issue +import logging +log = logging.getLogger(__name__) + + class PagureIssue(Issue): TITLE = 'paguretitle' DATE_CREATED = 'paguredatecreated' @@ -204,9 +207,9 @@ def issues(self): issues.extend(self.get_issues(repo, ('issues', 'issues'))) issues.extend(self.get_issues(repo, ('pull-requests', 'requests'))) - log.name(self.target).debug(" Found {0} issues.", len(issues)) + log.debug(" Found %i issues.", len(issues)) issues = filter(self.include, issues) - log.name(self.target).debug(" Pruned down to {0} issues.", len(issues)) + log.debug(" Pruned down to %i issues.", len(issues)) for repo, issue in issues: # Stuff this value into the upstream dict for: diff --git a/bugwarrior/services/phab.py b/bugwarrior/services/phab.py index 8f0b4132f..bd6f87c7e 100644 --- a/bugwarrior/services/phab.py +++ b/bugwarrior/services/phab.py @@ -1,11 +1,14 @@ import six -from twiggy import log from bugwarrior.services import IssueService, Issue # This comes from PyPI import phabricator +import logging +log = logging.getLogger(__name__) + + class PhabricatorIssue(Issue): TITLE = 'phabricatortitle' URL = 'phabricatorurl' @@ -92,7 +95,7 @@ def issues(self): issues = self.api.maniphest.query(status='status-open') issues = list(issues.iteritems()) - log.name(self.target).info("Found %i issues" % len(issues)) + log.info("Found %i issues" % len(issues)) for phid, issue in issues: @@ -135,7 +138,7 @@ def issues(self): diffs = self.api.differential.query(status='status-open') diffs = list(diffs) - log.name(self.target).info("Found %i differentials" % len(diffs)) + log.info("Found %i differentials" % len(diffs)) for diff in list(diffs): diff --git a/bugwarrior/services/redmine.py b/bugwarrior/services/redmine.py index 76d0aebc6..cbc078009 100644 --- a/bugwarrior/services/redmine.py +++ b/bugwarrior/services/redmine.py @@ -1,10 +1,12 @@ import six import requests -from twiggy import log from bugwarrior.config import die from bugwarrior.services import Issue, IssueService, ServiceClient +import logging +log = logging.getLogger(__name__) + class RedMineClient(ServiceClient): def __init__(self, url, key, auth): @@ -136,7 +138,7 @@ def validate_config(cls, config, target): def issues(self): issues = self.client.find_issues(self.user_id) - log.name(self.target).debug(" Found {0} total.", len(issues)) + log.debug(" Found %i total.", len(issues)) for issue in issues: yield self.get_issue_for_record(issue) diff --git a/bugwarrior/services/teamlab.py b/bugwarrior/services/teamlab.py index 9be1df5af..c12584a67 100644 --- a/bugwarrior/services/teamlab.py +++ b/bugwarrior/services/teamlab.py @@ -1,10 +1,12 @@ import six import requests -from twiggy import log from bugwarrior.config import die from bugwarrior.services import Issue, IssueService, ServiceClient +import logging +log = logging.getLogger(__name__) + class TeamLabClient(ServiceClient): def __init__(self, hostname, verbose=False): @@ -138,13 +140,11 @@ def validate_config(cls, config, target): def issues(self): issues = self.client.get_task_list() - log.name(self.target).debug( - " Remote has {0} total issues.", len(issues)) + log.debug(" Remote has %i total issues.", len(issues)) # Filter out closed tasks. issues = filter(lambda i: i["status"] == 1, issues) - log.name(self.target).debug( - " Remote has {0} active issues.", len(issues)) + log.debug(" Remote has %i active issues.", len(issues)) for issue in issues: yield self.get_issue_for_record(issue) diff --git a/bugwarrior/services/trac.py b/bugwarrior/services/trac.py index 5a096c3f1..3bad8a917 100644 --- a/bugwarrior/services/trac.py +++ b/bugwarrior/services/trac.py @@ -2,12 +2,14 @@ import csv import cStringIO as StringIO import requests -from twiggy import log import urllib from bugwarrior.config import die from bugwarrior.services import Issue, IssueService +import logging +log = logging.getLogger(__name__) + class TracIssue(Issue): SUMMARY = 'tracsummary' @@ -153,10 +155,10 @@ def issues(self): issues[i][1]['url'] = "%s/ticket/%s" % (base_url, tickets[i]['id']) issues[i][1]['number'] = int(tickets[i]['id']) - log.name(self.target).debug(" Found {0} total.", len(issues)) + log.debug(" Found %i total.", len(issues)) issues = filter(self.include, issues) - log.name(self.target).debug(" Pruned down to {0}", len(issues)) + log.debug(" Pruned down to %i", len(issues)) for project, issue in issues: issue_obj = self.get_issue_for_record(issue) diff --git a/setup.py b/setup.py index 2fb1dda98..dadaa0da4 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,6 @@ include_package_data=True, zip_safe=False, install_requires=[ - "twiggy", "requests", "offtrac", "python-bugzilla",