Skip to content
This repository was archived by the owner on Apr 27, 2019. It is now read-only.

Commit 15477bd

Browse files
author
Marv Cool
committed
adds timestamp to log
1 parent 8527bbb commit 15477bd

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

plugin_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,6 @@ def wrapped_function(self, data):
158158
return res
159159

160160
def print_this_defered_failure(f):
161-
print(f)
161+
logging.error(f)
162162

163163
return wrapped_function

server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def broadcast(self, text, channel=1, world='', name=''):
518518
for p in self.protocols.itervalues():
519519
p.send_chat_message(text)
520520
except Exception as e:
521-
print e
521+
logging.error(e)
522522

523523
def buildProtocol(self, address):
524524
"""
@@ -546,7 +546,7 @@ def buildProtocol(self, address):
546546

547547

548548
if __name__ == '__main__':
549-
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
549+
logging.basicConfig(format='[%(asctime)-15s] %(levelname)s:%(message)s', level=logging.DEBUG)
550550
logging.info("Started server.")
551551
factory = StarryPyServerFactory()
552552
reactor.listenTCP(21025, factory)

0 commit comments

Comments
 (0)