当前位置: 首页>>代码示例>>Python>>正文


Python ComLog.getLogger方法代码示例

本文整理汇总了Python中comoonics.ComLog.getLogger方法的典型用法代码示例。如果您正苦于以下问题:Python ComLog.getLogger方法的具体用法?Python ComLog.getLogger怎么用?Python ComLog.getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comoonics.ComLog的用法示例。


在下文中一共展示了ComLog.getLogger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __new__

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
 def __new__(cls, *args, **kwds):
     if len (args) > 0 and isinstance(args[0], Node):
         __type=args[0].getAttribute("type")
         #print "getCopyObject(%s)" %(element.tagName)
         if __type == "disk":
             from ComPartitionCopyObject import PartitionCopyObject
             cls=PartitionCopyObject
         elif __type == "filesystem":
             from ComFilesystemCopyObject import FilesystemCopyObject
             cls=FilesystemCopyObject
         elif __type == "lvm":
             from ComLVMCopyObject import LVMCopyObject
             cls=LVMCopyObject
         elif __type == "backup":
             from ComArchiveCopyObject import ArchiveCopyObject
             cls=ArchiveCopyObject
         elif _copyobject_registry.has_key(__type):
             cls=_copyobject_registry[__type]
             #from ComPathCopyObject import PathCopyObject
             #cls=PathCopyObject
         else:
             raise UnsupportedCopyObjectException("Unsupported CopyObject type %s in element %s" % (__type, args[0].tagName))
         ComLog.getLogger(CopyObject.__logStrLevel__).debug("Returning new object %s" %(cls))
         return object.__new__(cls, args, kwds)
     else:
         return object.__new__(cls, args, kwds)
开发者ID:Open-Sharedroot,项目名称:Open-Sharedroot-cluster-suite,代码行数:28,代码来源:ComCopyObject.py

示例2: create

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
    def create(self):
        """
        Newly creates the logical volume
        """
        LinuxVolumeManager.has_lvm()
        size=""

        if self.ondisk and self.getAttribute("overwrite", "false") == "true":
            self.remove()

        try:
            self.init_from_disk()
        except:
            pass

        if self.ondisk:
            raise LinuxVolumeManager.LVMAlreadyExistsException(self.__class__.__name__+"("+str(self.getAttribute("name"))+")")
        try:
            size=self.getAttribute("size")
            if int(self.getAttribute("size")) > int(self.parentvg.getAttribute("free")):
                ComLog.getLogger(self.__logStrLevel__).warn("Requested LV size %s is too big taking free %s" % (self.getAttribute("size"), self.parentvg.getAttribute("free")))
                self.setAttribute("size", self.parentvg.getAttribute("free"))
                size=self.getAttribute("size")
        except NameError:
            if ComSystem.isSimulate():
                size="1000"
            else:
                size=self.parentvg.getAttribute("free")
        LinuxVolumeManager.lvm('lvcreate', '-L %sM' %size, '-n %s' %str(self.getAttribute("name")), '%s' %str(self.parentvg.getAttribute("name")))
        self.init_from_disk()
        if ComSystem.isSimulate():
            self.ondisk=True
开发者ID:Open-Sharedroot,项目名称:Open-Sharedroot-cluster-suite,代码行数:34,代码来源:ComLVM.py

示例3: do_help

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
    def do_help(self, arg):
        ComLog.getLogger().debug("do_help(%s)" %(arg))
        arg=arg.strip()
        arg=arg.replace(" ", "_")
        if arg == '?' or arg == "help":
            cmds_keys=self.getCommands("do_")
            self.print_topics("",  cmds_keys, 15, 6)
            #self.print_topics(self.undoc_header, cmds_undoc, 15,80)
        elif arg:
            # XXX check arg syntax
            try:
                func = getattr(self, 'help_' + arg)
            except AttributeError:
                cmds_keys=self.getCommands("do_%s_" %(arg))
                if cmds_keys:
                    ComLog.getLogger().debug("do_help(%s, %s)" %(arg, cmds_keys))
                    self.print_topics("", cmds_keys, 15, 6)
                else:
                    try:
                        doc=getattr(self, 'do_' + arg).__doc__
                        if doc:
                            self.stdout.write("%s"%str(doc))
                            return
                    except AttributeError:
                        pass
#                    self.stdout.write("%s\n"%str(self.nohelp % (arg)))
                return
            func()
        else:
            self.stdout.write(HP_EVA_SSSU_Sim.DEFAULT_HELP)
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:32,代码来源:ComHP_EVA_SSSU_Sim.py

示例4: testlogger

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [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"))
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:37,代码来源:test_ComLog.py

示例5: getCommands

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
    def getCommands(self, what):
            names = self.get_names()
            cmds = {}
            prevname = ''
            for name in names:
                if name[:len(what)] == what:
                    if name == prevname:
                        continue
                    prevname = name
                    under1=len(what)+name[len(what):].find("_")+1
#                    under2=-1
#                    if under1>0:
#                        under2=under1+name[under1:].find("_")+1
                    ComLog.getLogger().debug("do_help(name %s, what %s, under1 %u/%s" %(name, what, under1, name[:under1]))

                    if under1==len(what):
                        cmds[name[len(what):]]=1
                    elif under1>0 and not hasattr(self, name[:under1-1]):
                        cmds[name[len(what):]]=1
                    #elif not hasattr(self, "%s_%s" %(name[:name(+len
                    #    cmds[name[len(what):]]=1

#            self.stdout.write("%s\n"%str(self.doc_leader))
            self.stdout.write("%s" %(self.doc_header))
#            ComLog.getLogger().debug("do_help(cmds: %s" %(cmds))
            cmds_keys=cmds.keys()
            cmds_keys.sort()
            return cmds_keys
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:30,代码来源:ComHP_EVA_SSSU_Sim.py

示例6: doPre

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
    def doPre(self):
        """
        Unpacks the given file to dest
        """
        srcfile=self.getAttribute("name")
        destfile=self.getAttribute("dest")
        __mkdir=self.getAttributeBoolean("mkdir", default=True)

        if not ComSystem.execMethod(os.path.exists, destfile) and __mkdir:
            ComLog.getLogger(ArchiveRequirement.__logStrLevel__).debug("Path %s does not exists. I'll create it." % destfile)
            os.makedirs(destfile)

        if self.check() and not ComSystem.isSimulate():
            if not os.access(srcfile, os.R_OK) or not os.access(destfile, os.F_OK) or not os.access(destfile, os.W_OK):
                raise ArchiveRequirementException("Either srcfile %s is not readable or dest %s is not writeable" % (srcfile, destfile))

        __cmd="rm -rf %s/*" % destfile
        (rc, rv) = ComSystem.execLocalGetResult(__cmd)
        if rc >> 8 != 0:
            raise RuntimeError("running \"%s\" failed: %u, %s" % (__cmd, rc,rv))

        self.olddir=os.curdir
        ComSystem.execMethod(os.chdir, destfile)
        __cmd="gzip -cd %s | cpio -i" % srcfile
        (rc, rv, stderr) = ComSystem.execLocalGetResult(__cmd, True)
        if rc >> 8 != 0:
            raise RuntimeError("running \"%s\" failed: %u, %s, %s" % (__cmd, rc,rv, stderr))
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:29,代码来源:ComArchiveRequirement.py

示例7: getCopyObject

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
def getCopyObject(element, doc):
    """ Factory function to create Copyset Objects"""
    if isinstance(element, Node):
        __type=element.getAttribute("type")
        #print "getCopyObject(%s)" %(element.tagName)
        if __type == "disk":
            from ComPartitionCopyObject import PartitionCopyObject
            cls=PartitionCopyObject
        elif __type == "filesystem":
            from ComFilesystemCopyObject import FilesystemCopyObject
            cls=FilesystemCopyObject
        elif __type == "lvm":
            from ComLVMCopyObject import LVMCopyObject
            cls=LVMCopyObject
        elif __type == "backup":
            from ComArchiveCopyObject import ArchiveCopyObject
            cls=ArchiveCopyObject
        elif _copyobject_registry.has_key(__type):
            cls=_copyobject_registry[__type]
            #from ComPathCopyObject import PathCopyObject
            #cls=PathCopyObject
        else:
            raise UnsupportedCopyObjectException("Unsupported CopyObject type %s in element %s" % (__type, element.tagName))
        ComLog.getLogger(CopyObject.__logStrLevel__).debug("Returning new object %s" %(cls))
        return cls(element, doc)
    else:
        raise UnsupportedCopyObjectException("Wrong parameters passed to factory method getCopyObject. Expected element, doc.")
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:29,代码来源:ComCopyObject.py

示例8: updateMetaData

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
 def updateMetaData(self, element):
    ComLog.getLogger(self.__logStrLevel__).debug("%u logical volumes cloning all from source" %(len(self.getVolumeGroup().getLogicalVolumes())))
    #ComLog.getLogger(self.__logStrLevel__).debug("Element to copy %s" %(element))
    if (len(self.getVolumeGroup().getLogicalVolumes()) == 0):
       #ComLog.getLogger(self.__logStrLevel__).debug("0 logical volumes cloning all from source")
       XmlTools.merge_trees_with_pk(element, self.getVolumeGroup().getElement(), self.document, "name", XmlTools.ElementFilter("logicalvolume"))
       self.vg=VolumeGroup(self.getVolumeGroup().getElement(), self.getDocument())
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:9,代码来源:ComLVMCopyObject.py

示例9: selection_changed

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
 def selection_changed(self, selection, dest, filter):
     (model, iter) = selection.get_selected()
     ComLog.getLogger(__logStrLevel__).debug("Selection changed %s, %s, %s %s" % (model, iter, dest, filter))
     dest.clear()
     if iter:
         dest.createStoreModelFromNode(model.get_value(iter, DOMModel.COLUMN_NODE).get_data(DOMModel.NODE_KEY))
     if filter:
         filter.refilter()
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:10,代码来源:ComDOMTreeView.py

示例10: serialize

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
    def serialize(self, element):
        from comoonics.storage.ComArchive import Archive
        earchive=self.getElement().getElementsByTagName("archive")[0]
        archive=Archive(earchive, self.getDocument())
#        print "Created archive: %s" %(archive)
        ComLog.getLogger(self.__logStrLevel__).debug("Saving element %s to archive" %(element))
        archive.addNextDOMElement(element)
        ComLog.getLogger(self.__logStrLevel__).debug("Saved element %s to archive element" %(element.tagName))
开发者ID:Open-Sharedroot,项目名称:Open-Sharedroot-cluster-suite,代码行数:10,代码来源:ComMetadataSerializer.py

示例11: delete_attribute

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
 def delete_attribute(self, item, model, iter, name):
     self.status("Menu Delete attribute... " + name + " pressed menuitem %s, model %s, iter %s" % (item, model, iter))
     value = model.get_value(iter, DOMModel.COLUMN_NODE)
     ref_node=value.get_data(DOMModel.NODE_KEY)
     ref_node.removeAttribute(name)
     ComLog.getLogger(__logStrLevel__).debug("ref_node: %s" % ref_node)
     self.__basemodelr.clear()
     self.__basemodelr.createStoreModelFromNode(ref_node)
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:10,代码来源:ComDOMTreeView.py

示例12: parseClusterConfFP

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
def parseClusterConfFP(_clusterconffp, _clusterconf, _validate=False):
    from comoonics import ComLog
    from comoonics import XmlTools
    try:
        doc = XmlTools.parseXMLFP(_clusterconffp)
    except Exception, arg:
        ComLog.getLogger().critical("Problem while reading clusterconfiguration (%s): %s" %(_clusterconf, str(arg)))
        raise
开发者ID:Open-Sharedroot,项目名称:Open-Sharedroot-cluster-suite,代码行数:10,代码来源:__init__.py

示例13: saveFile

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
 def saveFile(self, _uri=None):
     if not _uri:
         _uri=self.filename
     ComLog.getLogger(__logStrLevel__).debug("file: %s" % _uri)
     stream=open(_uri,"w+")
     PrettyPrint(self.__basemodell.document, stream)
     self.filename=_uri
     self.status("save to file %s succeeded" % _uri)
     self.updateTitle(sefl.filename)
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:11,代码来源:ComDOMTreeView.py

示例14: getRootPartition

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
 def getRootPartition(self):
     _dev = self._scanRootDevice()
     ComLog.getLogger(__logStrLevel__).debug("detected rootdevice %s" %_dev)                
     if not _dev: 
         return
     _pv = self._getLVM_physicalVolume(_dev)
     if _pv:
         return [ self._normalizeDisk(_pv)[1] ]
     return [ self._normalizeDisk(_dev) [1] ]
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:11,代码来源:ComStorageAssistantHelper.py

示例15: dtd_changed

# 需要导入模块: from comoonics import ComLog [as 别名]
# 或者: from comoonics.ComLog import getLogger [as 别名]
 def dtd_changed(self, filedialog, chooser):
     ComLog.getLogger(__logStrLevel__).debug("dtd changed pressed %s, %s." %(filedialog, chooser))
     try:
         self.newFromDTDFile(filedialog.get_filename())
         chooser.get_model().clear()
         for element_txt in self.dtd.get_elements():
             chooser.append_text(element_txt)
     except:
         pass
开发者ID:MarcGrimme,项目名称:comoonics-cluster-suite,代码行数:11,代码来源:ComDOMTreeView.py


注:本文中的comoonics.ComLog.getLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。