mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 18:26:32 +01:00
Use Twisted's logging facilities.
This commit is contained in:
parent
f9f24f6616
commit
b47d0d2b07
3 changed files with 9 additions and 6 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from twisted.python import log
|
||||
|
||||
import session_mgr
|
||||
import commands_privileged
|
||||
import commands_general
|
||||
|
|
@ -47,7 +49,7 @@ def log_errmsg(errormsg):
|
|||
|
||||
errormsg: (string) The message to be logged.
|
||||
"""
|
||||
print 'ERROR: %s' % (errormsg,)
|
||||
log.error('ERROR: %s' % (errormsg,))
|
||||
|
||||
def log_infomsg(infomsg):
|
||||
"""
|
||||
|
|
@ -55,7 +57,7 @@ def log_infomsg(infomsg):
|
|||
|
||||
debugmsg: (string) The message to be logged.
|
||||
"""
|
||||
print '%s' % (infomsg,)
|
||||
log.msg('%s' % (infomsg,))
|
||||
|
||||
def time_format(seconds, style=0):
|
||||
"""
|
||||
|
|
@ -149,4 +151,4 @@ def word_wrap(text, width=78):
|
|||
) >= width)],
|
||||
word),
|
||||
text.split(' ')
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import sys
|
|||
|
||||
from twisted.application import internet, service
|
||||
from twisted.internet import protocol, reactor, defer
|
||||
from twisted.python import log
|
||||
|
||||
from django.db import models
|
||||
from django.db import connection
|
||||
|
|
@ -120,4 +121,4 @@ mud_service = EvenniaService('Evennia Server')
|
|||
|
||||
# Sheet sheet, fire ze missiles!
|
||||
serviceCollection = service.IServiceCollection(application)
|
||||
internet.TCPServer(4000, mud_service.getEvenniaServiceFactory()).setServiceParent(serviceCollection)
|
||||
internet.TCPServer(4000, mud_service.getEvenniaServiceFactory()).setServiceParent(serviceCollection)
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ class SessionProtocol(StatefulTelnetProtocol):
|
|||
session_mgr.add_session(self)
|
||||
self.game_connect_screen()
|
||||
self.prep_session()
|
||||
print 'Connection:', self
|
||||
print 'Sessions active:', len(session_mgr.get_session_list())
|
||||
functions_general.log_infomsg('Connection: %s' % (self,))
|
||||
functions_general.log_infomsg('Sessions active: %d' % (len(session_mgr.get_session_list()),))
|
||||
|
||||
def getClientAddress(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue