Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def tostr(b):

logger = logging.getLogger(__name__)

logger.handlers.clear() # really needed? maybe for use as library...

debug = logger.debug
info = logger.info
warning = logger.warning
Expand Down Expand Up @@ -697,8 +699,8 @@ def _normalize_filenames(self):
for i,p in enumerate(self.items):
if debugmode:
debug(" patch type = " + p.type)
debug(" source = " + p.source)
debug(" target = " + p.target)
debug(" source = " + tostr(p.source))
debug(" target = " + tostr(p.target))
if p.type in (HG, GIT):
# TODO: figure out how to deal with /dev/null entries
debug("stripping a/ and b/ prefixes")
Expand Down Expand Up @@ -1157,6 +1159,7 @@ def main():
loglevel = verbosity_levels[options.verbosity]
logformat = "%(message)s"
logger.setLevel(loglevel)
logger.addHandler(streamhandler)
streamhandler.setFormatter(logging.Formatter(logformat))

if options.debugmode:
Expand Down