本文整理汇总了Python中comoonics.ComLog.fileConfig方法的典型用法代码示例。如果您正苦于以下问题:Python ComLog.fileConfig方法的具体用法?Python ComLog.fileConfig怎么用?Python ComLog.fileConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comoonics.ComLog
的用法示例。
在下文中一共展示了ComLog.fileConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testlogger
# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import fileConfig [as 别名]
def testlogger(self):
import logging
import inspect
import os.path
from comoonics import ComLog
_mylogger=logging.getLogger("comoonics.ComLog")
logging.basicConfig()
_mylogger.setLevel(logging.DEBUG)
#from comoonics.db.ComDBLogger import DBLogger
#registerHandler("DBLogger", DBLogger)
_filenames=("loggingconfig.ini")
ComLog.getLogger().info("Testing ComLog:")
loggers={"test1": logging.DEBUG,
"test2": logging.INFO,
"test3": logging.WARNING}
for loggername in loggers.keys():
print "%s level: %s" %(loggername, logging.getLevelName(loggers[loggername]))
ComLog.setLevel(loggers[loggername], loggername)
self.__testLogger(loggername, ComLog.getLogger(loggername))
print("mylogger without level")
self.__testLogger("mylogger", ComLog.getLogger("mylogger"))
cp=None
print("ComLog._classregistry: %s" %ComLog._classregistry)
for _filename in _filenames:
logging.shutdown()
print("Testing configfile %s/%s cwd: %s" %(os.path.dirname(inspect.getfile(self.__class__)), _filename, os.path.curdir))
ComLog.fileConfig(os.path.join(os.path.dirname(inspect.getfile(self.__class__)), _filename), None, )
rootlogger=ComLog.getLogger()
self.__testLogger("root", rootlogger)
print("handlernames: %s" %rootlogger.manager.loggerDict.keys())
for _lname in [ "atix", "atix", "atix.atix1" ]:
self.__testLogger(_lname, logging.getLogger(_lname))
self.__testLogger(_lname+".test", logging.getLogger(_lname+".test"))
示例2: setUp
# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import fileConfig [as 别名]
def setUp(self):
import inspect
import os.path
self.filename=os.path.join(os.path.dirname(inspect.getfile(self.__class__)), "loggingconfig.xml")
self.cp=ConfigParser()
self.cp.read(self.filename)
self.loggers=["atix", "atix.atix1", "atix.atix2"]
ComLog.fileConfig(self.filename)
示例3: __init__
# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import fileConfig [as 别名]
def __init__(self, element, doc):
ComDataObject.DataObject.__init__(self, element, doc)
self.copysets=list()
self.modificationsets=list()
self.allsets=list()
self.donesets=list()
self.currentset=None
elogging=self.getElement().getElementsByTagName("logging")
#ComLog.getLogger().info("logger.effectivelevel: %s/%u" %(logging.getLevelName(self._logger.getEffectiveLevel()),self._logger.getEffectiveLevel()))
if len(elogging)>0:
ComLog.fileConfig(elogging[0])
self._logger.disabled=0
for child in self.getElement().childNodes:
if child.nodeType == Node.ELEMENT_NODE and child.tagName == ComCopyset.Copyset.TAGNAME:
cs=ComCopyset.getCopyset(child, doc)
self.copysets.append(cs)
self.allsets.append(cs)
elif child.nodeType == Node.ELEMENT_NODE and child.tagName == ComModificationset.Modificationset.TAGNAME:
ms=ComModificationset.getModificationset(child, doc)
self.modificationsets.append(ms)
self.allsets.append(ms)