Skip to content

Commit

Permalink
Merge branch 'release/v1.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Apr 9, 2014
2 parents 047a73d + 0f5ee0f commit 3e76a9f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
Binary file modified alfred-workflow.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion workflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def main(wf):
"""

__version__ = '1.3'
__version__ = '1.4.1'

from .workflow import Workflow, PasswordNotFound, KeychainError
from .workflow import (ICON_ERROR, ICON_WARNING, ICON_NOTE, ICON_INFO,
Expand Down
33 changes: 22 additions & 11 deletions workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,22 +837,33 @@ def logger(self):
"""

if not self._logger:
# Initialise logging
logfile = logging.handlers.RotatingFileHandler(self.logfile,
maxBytes=1024*1024,
backupCount=0)
if self._logger:
return self._logger

# Initialise new logger and optionally handlers
logger = logging.getLogger('workflow')

if not logger.handlers: # Only add one set of handlers
logfile = logging.handlers.RotatingFileHandler(
self.logfile,
maxBytes=1024*1024,
backupCount=0)

console = logging.StreamHandler()
fmt = logging.Formatter('%(asctime)s %(filename)s:%(lineno)s'
' %(levelname)-8s %(message)s',
datefmt='%H:%M:%S')

fmt = logging.Formatter(
'%(asctime)s %(filename)s:%(lineno)s'
' %(levelname)-8s %(message)s',
datefmt='%H:%M:%S')

logfile.setFormatter(fmt)
console.setFormatter(fmt)
logger = logging.getLogger('')

logger.addHandler(logfile)
logger.addHandler(console)
logger.setLevel(logging.DEBUG)
self._logger = logger

logger.setLevel(logging.DEBUG)
self._logger = logger

return self._logger

Expand Down

0 comments on commit 3e76a9f

Please sign in to comment.