本文整理汇总了Python中gamit.log.logger.Logger.logInfo方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.logInfo方法的具体用法?Python Logger.logInfo怎么用?Python Logger.logInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gamit.log.logger.Logger
的用法示例。
在下文中一共展示了Logger.logInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onMessage
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def onMessage(self, connId, payload, isBinary):
Logger.logDebug("WsAcceptor.onMessage", connId)
if connId not in self.connMap:
Logger.logInfo("connId not found")
return
self.rmiServer.onMessage(connId, payload, isBinary)
示例2: __initDatabase
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def __initDatabase(self, config):
xml = xmlParser.parse(config)
for child in xml.getroot():
tag = child.tag
text = child.text
if tag == 'name':
self.dbname = text
elif tag == 'ip':
self.dbip = text
elif tag == 'port':
self.dbport = int(text)
elif tag == 'username':
self.dbuser = text
elif tag == 'passwd':
self.dbpasswd = text
if not self.dbname:
Logger.logInfo("__Database.__initDatabase", "database name not specified")
return False
if not self.dbip:
self.dbip = "127.0.0.1"
if not self.dbport:
self.dbport = 27017
return True
示例3: start
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def start(self, isDebug):
wsUrl = "ws://{}:{}".format(self.ip, self.port)
Logger.logInfo("Connecting to {}".format(wsUrl))
factory = MyClientFactory(wsUrl, debug=isDebug)
factory.connector__ = self
reactor.connectTCP(self.ip, self.port, factory)
self.factory = factory
示例4: initServant
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def initServant(self):
channel = ServerConfigManager.getChannelByType(AppType.DBCACHE)
if not channel:
Logger.logInfo("DBCACHE channel not configured.")
return False
rmiServer = self.createRmiServer(channel, ServerConfigManager.isDebug)
ServantSetting.initServant(rmiServer)
return True
示例5: onOpen
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def onOpen(self):
Logger.logInfo("ConnectionInfo", "Connected to dbcache")
ConnectionInfo.setDbCacheOpen(True)
if not DbCacheConnectCallback.isDataLoaded:
UserDataLoader.loadUserInfos()
ResourceLoader.load()
DbCacheConnectCallback.isDataLoaded = True
示例6: onInvoke
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def onInvoke(self, connId, _is):
try:
interface = _is.readString()
method = _is.readString()
if interface in self.servantMap:
self.servantMap[interface].invoke(connId, method, _is, self.beforeInvoke)
else:
raise SerializeError("Servant {} not registered".format(interface))
except Exception as ex:
Logger.logInfo(ex)
# self.servantMap[interface].onError(connId, _is, ex)
#end of RmiServer
示例7: _initDbLogProxy
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def _initDbLogProxy(self):
channel = ServerConfigManager.getChannelByType(AppType.DBLOG)
if not channel:
Logger.logInfo("DbLog channel not configured.")
return False
dbConnCb = DbLogConnectCallback(channel)
rmiClient = self.addProxyByChannel(channel, ServerConfigManager.isDebug, dbConnCb, dbConnCb, [True], [False])
ProxySetting.initDbLogProxy(rmiClient)
return True
示例8: send
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def send(self, payload, isBinary=True):
if not self.running:
Logger.logInfo("WsConnector.send", " Connect closed")
return
try:
#Logger.logDebug("connector.send")
self.ws.sendMessage(payload, isBinary)
except Exception as ex:
Logger.logDebug(ex)
Logger.log("[WsConnector.send]", ex)
raise ex
示例9: start
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def start(self, isDebug):
wsUrl = "ws://{}:{}".format(self.ip, self.port)
Logger.logInfo("Listening on {}".format(wsUrl))
factory = WebSocketServerFactory(wsUrl, debug=isDebug)
_WSServerProtocol.proxy = self
factory.protocol = _WSServerProtocol
reactor.listenTCP(self.port, factory)
self.factory = factory
self.running = True
示例10: onOpen
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def onOpen(self):
Logger.logInfo("ConnectionInfo", "Connected to dbcache")
ConnectionInfo.setDbCacheOpen(True)
proxy = ProxyManager.getProxy(AppType.DBCACHE, "IDbTest")
if proxy:
for i in range(10):
msg = AnRmiTest()
msg.ip = "{}".format(ServantSetting.getChannelId())
msg.shortDesc = "Run, Chicken..."
msg.passedTimes = i + ServantSetting.getChannelId() * 100
proxy.sayhello(IDbTest_Sayhello_callback(), msg)
print("Run, Chiken", i)
示例11: sayhello
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def sayhello(self, hello, _request):
table = MongoDatabase.findTableByMessageType(AnRmiTest)
if not table:
raise Exception("Table Not Found")
table.update(hello)
res = table.findOne(hello.ip)
if not res:
raise Exception("Db Engine Error")
Logger.logInfo("IDbTestImpl.sayhello", "response")
_request.response(res)
MessageManager.broadcast(ETestCommand.FirstMessage, res)
示例12: onMessage
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def onMessage(self, connId, payload, isBinary):
try:
payload = simpleDecrypt(payload)
_is = Serializer(payload)
_is.startToRead()
rmiType = _is.readByte()
if rmiType == RmiDataType.RmiCall:
self.onInvoke(connId, _is)
elif rmiType == RmiDataType.MessageBlock:
self.messageManager.onMessage(_is)
else:
raise SerializeError("Unknown RmiDataType")
except Exception as ex:
Logger.logInfo(ex)
示例13: initTable
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def initTable(self, db):
if not self.msgType:
Logger.logInfo("struct {} is not defined".format(self.msgName))
return False
if not self.name in db.collection_names():
if self.key:
db[self.name].create_index([(self.key, ASCENDING)])
for idx in self.indexes:
db[self.name].create_index([(idx, ASCENDING)])
self.table = db[self.name]
return True
示例14: initClient
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def initClient(self):
channel = ServerConfigManager.getChannelByType(AppType.GATE)
if not channel:
Logger.logInfo("Gate channel not configured.")
return False
Logger.logInfo("Init Proxy {}:{}".format(channel.ip, channel.port))
connector = Connector(channel.ip, channel.port)
self.client = RmiClient(channel.type, connector, ServerConfigManager.isDebug)
self.client.setOnOpenCallback(runTest)
ProxySetting.initGateProxy(self.client)
return True
示例15: digest
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import logInfo [as 别名]
def digest(self, systemCommand):
"""
:type systemCommand: message.db.mongodb.utiltables.TSystemCommand
:rtype: bool
"""
operStatus = False
if systemCommand.commandType == ESysCommandType.AddSysTopic:
operStatus = self.__addSysTopic(systemCommand)
elif systemCommand.commandType == ESysCommandType.AddCommercialAd:
pass
else:
Logger.logInfo("__SystemCommandDigester.digest: undigested command type:", systemCommand.commandType)
return operStatus