Skip to content

Commit

Permalink
Instead of printing use the logging framework.
Browse files Browse the repository at this point in the history
  • Loading branch information
thedrow committed Mar 16, 2014
1 parent 15bd050 commit 406551c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion serf_master/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

import os
import sys
import logging

class SerfHandler(object):
def __init__(self):
self.name = os.environ['SERF_SELF_NAME']
self.role = os.environ['SERF_SELF_ROLE']
self.logger = logging.getLogger(type(self).__name__)
if os.environ['SERF_EVENT'] == 'user':
self.event = os.environ['SERF_USER_EVENT']
else:
self.event = os.environ['SERF_EVENT'].replace('-', '_')

def log(self, message):
print(message)
self.logger.info(message)


class SerfHandlerProxy(SerfHandler):
Expand Down

0 comments on commit 406551c

Please sign in to comment.