本文整理汇总了Python中gamit.log.logger.Logger.startLogging方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.startLogging方法的具体用法?Python Logger.startLogging怎么用?Python Logger.startLogging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gamit.log.logger.Logger
的用法示例。
在下文中一共展示了Logger.startLogging方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import startLogging [as 别名]
def main():
optParser = OptionParser()
optParser.add_option("-c", "--channel-id", type="int", dest="channelId")
options, args = optParser.parse_args()
channelId = options.channelId or 0
#load server configs
ServerConfigManager.loadConfig()
# start logger
logDirName = "log/gate"
if channelId > 0:
logDirName = "{}-{}".format(logDirName, channelId)
loggerDir = os.path.join(os.getcwd(), logDirName)
Logger.startLogging(loggerDir, ServerConfigManager.isDebug)
Logger.logInfo("loading configs...")
staticdata.dataloader.loadConfigs()
Logger.logInfo("Loading ImageToken Configs...")
ImageToken.loadConfig()
Logger.logInfo("Loading SMS Configs...")
SMSManager.loadConfig()
Logger.logInfo("Init db connection")
connConfig = os.path.join(parent_dir, "config/dbcache_connection_config.xml")
tableConfig = os.path.join(parent_dir, "staticdata/dbconfig/main_db_config.xml")
if not MongoDatabase.loadConfig(connConfig, tableConfig):
Logger.logInfo("DbCache", "Load MongoDatata Config Failed")
return
app = Application("Gate", channelId)
Logger.logInfo("initiating app...")
if app.init():
Logger.logInfo("starting mongodb")
if not MongoDatabase.start():
Logger.logInfo("Starting mongoDb Failed")
return
Logger.logInfo("starting scheduler...")
Scheduler.start()
# load everty thing
loadEveryThing()
# sys command load
Logger.logInfo("starting system command loader...")
SystemCommandLoder.start()
Logger.logInfo("starting app...")
app.start()
else:
raise Exception("Initiating Application Failed.")
Logger.logInfo("stopping app...")
app.stop()
示例2: main
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import startLogging [as 别名]
def main():
#load server configs
ServerConfigManager.loadConfig()
# start logger
loggerDir = os.path.join(os.getcwd(), "log/DbCache")
Logger.startLogging(loggerDir, ServerConfigManager.isDebug)
Logger.logInfo("loading configs...")
if not staticdata.dataloader.loadConfigs():
return
Logger.logInfo("Init db connection")
connConfig = os.path.join(parent_dir, "config/dbcache_connection_config.xml")
tableConfig = os.path.join(parent_dir, "staticdata/dbconfig/main_db_config.xml")
if not MongoDatabase.loadConfig(connConfig, tableConfig):
Logger.logInfo("DbCache", "Load MongoDatata Config Failed")
return
app = Application("DbCache")
Logger.logInfo("initiating app...")
if app.init():
Logger.logInfo("starting mongodb")
if not MongoDatabase.start():
Logger.logInfo("Starting mongoDb Failed")
return
# Logger.logInfo("starting scheduler...")
# Scheduler.start()
Logger.logInfo("starting system command loader...")
SystemCommandLoder.start()
Logger.logInfo("starting app...")
app.start()
else:
raise Exception("Initiating Application Failed.")
Logger.logInfo("stopping app...")
app.stop()
示例3: main
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import startLogging [as 别名]
def main():
ServerConfigManager.loadConfig()
# start logger
loggerDir = os.path.join(os.getcwd(), "log/test")
Logger.startLogging(loggerDir, ServerConfigManager.isDebug)
Logger.logInfo("loading configs...")
staticdata.dataloader.loadConfigs()
app = Application()
Logger.logInfo("initiating app...")
if app.init():
Logger.logInfo("starting app...")
app.start()
else:
raise Exception("Initiating Application Failed.")
Logger.logInfo("stopping app...")
app.stop()
示例4: main
# 需要导入模块: from gamit.log.logger import Logger [as 别名]
# 或者: from gamit.log.logger.Logger import startLogging [as 别名]
def main():
optParser = OptionParser()
optParser.add_option("-c", "--channel-id", type="int", dest="channelId")
options, args = optParser.parse_args()
channelId = options.channelId or 0
#load server configs
ServerConfigManager.loadConfig()
# start logger
logDirName = "log/servicegate"
if channelId > 0:
logDirName = "{}-{}".format(logDirName, channelId)
loggerDir = os.path.join(os.getcwd(), logDirName)
Logger.startLogging(loggerDir, ServerConfigManager.isDebug)
Logger.logInfo("loading configs...")
staticdata.dataloader.loadConfigs()
Logger.logInfo("Loading ImageToken Configs...")
ImageToken.loadConfig()
Logger.logInfo("Loading SMS Configs...")
SMSManager.loadConfig()
app = Application("Gate", channelId)
Logger.logInfo("initiating app...")
if app.init():
Logger.logInfo("starting scheduler...")
Scheduler.start()
Logger.logInfo("starting app...")
app.start()
else:
raise Exception("Initiating Application Failed.")
Logger.logInfo("stopping app...")
app.stop()