Skip to content

Commit

Permalink
update wakatime package
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Aug 9, 2013
1 parent ff8fe83 commit 7860db1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/wakatime/wakatime/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ def formatException(self, exc_info):
return exec_info[2].format_exc()


def set_log_level(logger, args):
level = logging.WARN
if args.verbose:
level = logging.DEBUG
logger.setLevel(level)


def setup_logging(args, version):
logger = logging.getLogger()
set_log_level(logger, args)
if len(logger.handlers) > 0:
return logger
logfile = args.logfile
Expand All @@ -81,8 +89,4 @@ def setup_logging(args, version):
)
handler.setFormatter(formatter)
logger.addHandler(handler)
level = logging.WARN
if args.verbose:
level = logging.DEBUG
logger.setLevel(level)
return logger

0 comments on commit 7860db1

Please sign in to comment.