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


Python Logger.add方法代码示例

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


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

示例1: CoffeescriptBuilder

# 需要导入模块: from pyaid.debug.Logger import Logger [as 别名]
# 或者: from pyaid.debug.Logger.Logger import add [as 别名]

#.........这里部分代码省略.........

            FileUtils.walkPath(path, walker, [path, rootPath])
            print("\n\nCOMPILATION RESULTS:" + CoffeescriptBuilder._results)

            if CoffeescriptBuilder._missing:
                print("\n\nMISSING IMPORTS:" + "\n\n")
                for n, v in DictUtils.iter(CoffeescriptBuilder._missing):
                    print(v["class"] + " [LINE: #" + str(v["line"]) + " | " + v["package"] + "]")
        else:
            print("COMPILING DIRECTORY: " + path)
            CoffeescriptBuilder._compileAllInDirectory(
                path, rootPath, debug=debug, trace=trace, force=force, compress=compress
            )

    # ___________________________________________________________________________________________________ getScriptsInPath
    @staticmethod
    def getScriptsInPath(path):
        files = []

        for f in os.listdir(path):
            if f.lower().endswith("." + CoffeescriptDependency.EXTENSION):
                files.append(os.path.join(path, f))

        return files

    # ===================================================================================================
    #                                                                               P R O T E C T E D

    # ___________________________________________________________________________________________________ _constructLibrary
    def _constructLibrary(self, target):
        try:
            if self._verbose:
                print("\n\n" + ("-" * 100) + "\n")
                self._log.add("LIBRARY: %s\n\tsource: %s\n\troot: %s" % (target.package, target.path, target.rootPath))

            # ---------------------------------------------------------------------------------------
            # Compile all includes using library data
            targets, imports, modules, includes = self._getLibraryData(target)

            # Process requires for all of the targets
            for t in targets + imports + modules:
                self._processRequires(t)

            # ---------------------------------------------------------------------------------------
            # IMPORTS

            # Compile all excludes skipping any exec or lib files that are listed in the import
            # statements.
            importExcludes = []
            for t in targets:
                for imp in self._imports[t.package]:
                    if not (imp.isExec or imp.isLib or imp.isInList(importExcludes)):
                        importExcludes.append(imp)

            # Compile all imports needed for the library. Any excludes are added to the shared
            # library to be made accessible via the VIZME registry.
            libImports = []
            sharedImports = []
            for t in imports + modules:
                for imp in self.imports[t.package]:
                    if not imp.isInList(libImports):
                        if imp.isInList(importExcludes):
                            if not imp.isInList(sharedImports):
                                sharedImports.append(imp)
                        else:
                            libImports.append(imp)
开发者ID:sernst,项目名称:PyAid,代码行数:70,代码来源:CoffeescriptBuilder.py

示例2: CoffeescriptBuilder

# 需要导入模块: from pyaid.debug.Logger import Logger [as 别名]
# 或者: from pyaid.debug.Logger.Logger import add [as 别名]

#.........这里部分代码省略.........
                    CoffeescriptBuilder._missing[n] = v

            os.path.walk(path, walker, [path, rootPath])
            print '\n\nCOMPILATION RESULTS:' + CoffeescriptBuilder._results

            if CoffeescriptBuilder._missing:
                print '\n\nMISSING IMPORTS:' + '\n\n'
                for n,v in CoffeescriptBuilder._missing.iteritems():
                    print v['class'] + ' [LINE: #' + str(v['line']) + ' | ' + v['package'] + ']'
        else:
            print 'COMPILING DIRECTORY: ' + path
            CoffeescriptBuilder._compileAllInDirectory(
                path, rootPath, debug=debug, trace=trace, force=force, compress=compress)

#___________________________________________________________________________________________________ getScriptsInPath
    @staticmethod
    def getScriptsInPath(path):
        files = []

        for f in os.listdir(path):
            if f.lower().endswith('.' + CoffeescriptDependency.EXTENSION):
                files.append(os.path.join(path, f))

        return files

#===================================================================================================
#                                                                               P R O T E C T E D

#___________________________________________________________________________________________________ _constructLibrary
    def _constructLibrary(self, target):
        try:
            if self._verbose:
                print "\n\n" + ('-'*100) + '\n'
                self._log.add(
                    'LIBRARY: %s\n\tsource: %s\n\troot: %s' % (
                        target.package, target.path, target.rootPath))

            #---------------------------------------------------------------------------------------
            # Compile all includes using library data
            targets, imports, modules, includes = self._getLibraryData(target)

            # Process requires for all of the targets
            for t in (targets + imports + modules):
                self._processRequires(t)

            #---------------------------------------------------------------------------------------
            # IMPORTS

            # Compile all excludes skipping any exec or lib files that are listed in the import
            # statements.
            importExcludes = []
            for t in targets:
                for imp in self._imports[t.package]:
                    if not (imp.isExec or imp.isLib or imp.isInList(importExcludes)):
                        importExcludes.append(imp)

            # Compile all imports needed for the library. Any excludes are added to the shared
            # library to be made accessible via the VIZME registry.
            libImports    = []
            sharedImports = []
            for t in (imports + modules):
                for imp in self.imports[t.package]:
                    if not imp.isInList(libImports):
                        if imp.isInList(importExcludes):
                            if not imp.isInList(sharedImports):
                                sharedImports.append(imp)
开发者ID:hannahp,项目名称:PyAid,代码行数:70,代码来源:CoffeescriptBuilder.py


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