• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python log.get_logger函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mi.core.log.get_logger函数的典型用法代码示例。如果您正苦于以下问题:Python get_logger函数的具体用法?Python get_logger怎么用?Python get_logger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    from mi.logging import config
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
    log = get_logger()

    config = {
            DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.adcps_jln',
            DataSetDriverConfigKeys.PARTICLE_CLASS: 'AdcpsJlnParticle'
        }
    log.trace("My ADCPS JLN Config: %s", config)

    def exception_callback(exception):
        log.debug("ERROR: " + exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()
    
    with open(sourceFilePath, 'rb') as file_handle:
        parser = AdcpPd0Parser(config, None, file_handle,
            lambda state, ingested: None,
            lambda data: None, exception_callback)
        
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream() 
  
    return particleDataHdlrObj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:25,代码来源:adcps_jln_driver.py


示例2: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    try:
        if basePythonCodePath is not None:
            pass
    except NameError:
        basePythonCodePath = os.curdir
    sys.path.append(basePythonCodePath)

    from mi.logging import config
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
    
    from mi.core.log import get_logger
    log = get_logger()

    """
    Build and return the parser
    """
    config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.ctdpf_ckl_wfp_particles',
        DataSetDriverConfigKeys.PARTICLE_CLASS: None,
        DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: {
            'instrument_data_particle_class': CtdpfCklWfpTelemeteredDataParticle,
            'metadata_particle_class': CtdpfCklWfpTelemeteredMetadataParticle
        }
    }
    log.debug("My Config: %s", config)
    driver = CtdpfCklWfpDriver(sourceFilePath, particleDataHdlrObj, config)
        
    return driver.process()
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:30,代码来源:ctdpf_ckl_wfp_telemetered_driver.py


示例3: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    from mi.logging import config
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
    log = get_logger()

    config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.adcps_jln_stc',
        DataSetDriverConfigKeys.PARTICLE_CLASS: None,
        DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: {
            AdcpsJlnStcParticleClassKey.METADATA_PARTICLE_CLASS:
                AdcpsJlnStcMetadataRecoveredDataParticle,
            AdcpsJlnStcParticleClassKey.INSTRUMENT_PARTICLE_CLASS:
                AdcpsJlnStcInstrumentRecoveredDataParticle,
        }
    }
    log.debug("My ADCPS JLN STC Config: %s", config)

    def exception_callback(exception):
        log.debug("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()

    with open(sourceFilePath, 'rb') as file_handle:
        parser = AdcpsJlnStcParser(config,
                                   None,
                                   file_handle,
                                   lambda state, ingested: None,
                                   lambda data: None,
                                   exception_callback)
                
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()  
        
    return particleDataHdlrObj
开发者ID:GrimJ,项目名称:mi-dataset,代码行数:34,代码来源:adcps_jln_stc_recovered_driver.py


示例4: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    log = get_logger()

    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.flord_l_wfp',
        DataSetDriverConfigKeys.PARTICLE_CLASS: 'FlordLWfpInstrumentParserDataParticle'
    }

    def exception_callback(exception):
        log.debug("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()

    with open(sourceFilePath, 'r') as stream_handle:
        parser = GlobalWfpEFileParser(parser_config, None,
                                      stream_handle,
                                      lambda state, ingested: None,
                                      lambda data: log.trace("Found data: %s", data),
                                      exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()

    return particleDataHdlrObj
开发者ID:GrimJ,项目名称:mi-dataset,代码行数:26,代码来源:flord_l_wfp_recovered_driver.py


示例5: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    from mi.logging import config
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
    log = get_logger()

    config = {
        DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: {
            'velocity': 'VelocityEarth',
            'engineering': 'AdcpsEngineering',
            'config': 'AdcpsConfig',
            'bottom_track': 'EarthBottom',
            'bottom_track_config': 'BottomConfig',
        }
    }
    log.trace("My ADCPS JLN Config: %s", config)

    def exception_callback(exception):
        log.error("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()

    with open(sourceFilePath, 'rb') as file_handle:
        parser = AdcpPd0Parser(config, file_handle, exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()

    return particleDataHdlrObj
开发者ID:GrimJ,项目名称:mi-dataset,代码行数:28,代码来源:adcps_jln_driver.py


示例6: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    log = get_logger()

    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.vel3d_k_wfp',
        DataSetDriverConfigKeys.PARTICLE_CLASS: ['Vel3dKWfpMetadataParticle',
                                                 'Vel3dKWfpInstrumentParticle',
                                                 'Vel3dKWfpStringParticle']
    }

    def exception_callback(exception):
        log.debug("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()

    with open(sourceFilePath, 'rb') as stream_handle:
        parser = Vel3dKWfpParser(parser_config,
                                 None,
                                 stream_handle,
                                 lambda state,file : None,
                                 lambda data : None,
                                 exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()


    return particleDataHdlrObj
开发者ID:emilyhahn,项目名称:mi-dataset,代码行数:30,代码来源:vel3d_k_wfp_recovered_driver.py


示例7: process

    def process(self):

        log = get_logger()

        try:
            file_handle = open(self._sourceFilePath, 'rb')
            filesize = os.path.getsize(file_handle.name)
            state = None
            parser_state = None
            
            def state_callback(state, ingested):
                pass
        
            def pub_callback(data):
                log.trace("Found data: %s", data)
            
            def sample_exception_callback(exception):
                self._particleDataHdlrObj.setParticleDataCaptureFailure()
                    
            parser = CtdpfCklWfpParser(self._config, parser_state, file_handle, lambda state, 
                                       ingested: state_callback(state, ingested), pub_callback, 
                                       sample_exception_callback, filesize)
    
            driver = DataSetDriver(parser, self._particleDataHdlrObj)
        
            driver.processFileStream()  
        finally:
            file_handle.close()
        
        return self._particleDataHdlrObj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:30,代码来源:ctdpf_ckl_wfp_driver.py


示例8: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
    
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    log = get_logger()
    
    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.nutnr_b_particles',
        DataSetDriverConfigKeys.PARTICLE_CLASS: None
    }

    def exception_callback(exception):
        log.debug("ERROR: " + exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()
    
    with open(sourceFilePath, 'r') as stream_handle:
        parser = NutnrBDclConcRecoveredParser(parser_config,
                                              stream_handle,
                                              lambda state, ingested : None,
                                              lambda data : None,
                                              exception_callback)
        
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()    

        
    return particleDataHdlrObj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:27,代码来源:nutnr_b_dcl_conc_recovered_driver.py


示例9: process

    def process(self):
        """
        Process a file by opening the file and instantiating a parser and driver
        """
        log = get_logger()

        with open(self._source_file_path, "rb") as file_handle:
            def exception_callback(exception):
                log.debug("Exception %s", exception)
                self._particle_data_hdlr_obj.setParticleDataCaptureFailure()

            # essentially comment out the state and data callbacks by inserting
            # lambda with None functions, so it doesn't complain about not being
            # able to pass arguments
            parser = GliderEngineeringParser(self._parser_config, None,
                                             file_handle,
                                             lambda state, ingested: None,
                                             lambda data: None,
                                             exception_callback)

            # instantiate the driver
            driver = DataSetDriver(parser, self._particle_data_hdlr_obj)
            # start the driver processing the file
            driver.processFileStream()

        return self._particle_data_hdlr_obj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:26,代码来源:driver_common.py


示例10: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
    """
    This is the method called by Uframe
    :param basePythonCodePath This is the file system location of mi-dataset
    :param sourceFilePath This is the full path and filename of the file to be parsed
    :param particleDataHdlrObj Java Object to consume the output of the parser
    :return particleDataHdlrObj
    """

    log = get_logger()

    with open(sourceFilePath, 'rb') as stream_handle:

        def exception_callback(exception):
                log.debug("Exception: %s", exception)
                particleDataHdlrObj.setParticleDataCaptureFailure()

        parser_config = {
            DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.ctdmo_ghqr_sio',
            DataSetDriverConfigKeys.PARTICLE_CLASS: ['CtdmoGhqrSioTelemeteredInstrumentDataParticle',
                                                     'CtdmoGhqrSioTelemeteredOffsetDataParticle']
        }

        parser = CtdmoGhqrSioTelemeteredParser(parser_config, stream_handle, exception_callback)

        # create and instance of the concrete driver class defined below
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()

    return particleDataHdlrObj
开发者ID:emilyhahn,项目名称:mi-dataset,代码行数:30,代码来源:ctdmo_ghqr_sio_telemetered_driver.py


示例11: parse

def parse(unused, source_file_path, particle_data_handler):
    """
    This is the method called by Uframe
    :param unused
    :param source_file_path This is the full path and filename of the file to be parsed
    :param particle_data_handler Java Object to consume the output of the parser
    :return particle_data_handler
    """
    log = get_logger()

    with open(source_file_path, 'r') as stream_handle:

        def exception_callback(exception):
                log.debug("Exception: %s", exception)
                particle_data_handler.setParticleDataCaptureFailure()

        # extract the serial number from the file name
        serial_num = get_serial_num_from_filepath(source_file_path)

        parser_config = {
            DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.ctdmo_ghqr_sio',
            DataSetDriverConfigKeys.PARTICLE_CLASS: ['CtdmoGhqrRecoveredInstrumentDataParticle'],
            INDUCTIVE_ID_KEY: serial_num
        }

        parser = CtdmoGhqrRecoveredCtParser(parser_config, stream_handle, exception_callback)

        # create and instance of the concrete driver class defined below
        driver = DataSetDriver(parser, particle_data_handler)
        driver.processFileStream()

    return particle_data_handler
开发者ID:danmergens,项目名称:mi-instrument,代码行数:32,代码来源:ctdmo_ghqr_ct_recovered_driver.py


示例12: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
    from mi.logging import config

    config.add_configuration(os.path.join(basePythonCodePath, "res", "config", "mi-logging.yml"))

    from mi.core.log import get_logger

    log = get_logger()

    from mi.dataset.dataset_driver import DataSetDriver, ParticleDataHandler

    from mi.dataset.parser.parad_k_stc_imodem import Parad_k_stc_imodemParser
    from mi.dataset.dataset_parser import DataSetDriverConfigKeys

    config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: "mi.dataset.parser.parad_k_stc_imodem",
        DataSetDriverConfigKeys.PARTICLE_CLASS: "Parad_k_stc_imodemDataParticle",
    }

    try:
        if particleDataHdlrObj is not None:
            pass
    except NameError:
        particleDataHdlrObj = ParticleDataHandler()

    try:
        if sourceFilePath is not None:
            pass
    except NameError:
        try:
            sourceFilePath = sys.argv[1]
        except IndexError:
            print "Need a source file path"
            sys.exit(1)

    def state_callback(state, ingested):
        pass

    def pub_callback(data):
        log.trace("Found data: %s", data)

    def exception_callback(exception):
        particleDataHdlrObj.setParticleDataCaptureFailure()

    stream_handle = open(sourceFilePath, "rb")

    try:
        parser = Parad_k_stc_imodemParser(config, None, stream_handle, state_callback, pub_callback, exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)

        driver.processFileStream()

    finally:
        stream_handle.close()

    stream_handle = open(sourceFilePath, "rb")
    return particleDataHdlrObj
开发者ID:jamundson,项目名称:mi-dataset,代码行数:58,代码来源:parad_k_stc_imodem_driver.py


示例13: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    log = get_logger()

    with open(sourceFilePath, "r") as stream_handle:

        def exception_callback(exception):
                log.debug("Exception: %s", exception)
                particleDataHdlrObj.setParticleDataCaptureFailure()

        parser = CtdbpCdefCpParser({}, stream_handle, exception_callback)
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()
    return particleDataHdlrObj
开发者ID:emilyhahn,项目名称:mi-dataset,代码行数:14,代码来源:ctdbp_cdef_cp_driver.py


示例14: process

    def process(self):
        log = get_logger()

        with open(self._sourceFilePath, "r") as file_handle:
            def exception_callback(exception):
                log.debug("Exception: %s", exception)
                self._particleDataHdlrObj.setParticleDataCaptureFailure()

            parser = FlortDjDclParser(self._parser_config, file_handle, exception_callback)

            driver = DataSetDriver(parser, self._particleDataHdlrObj)

            driver.processFileStream()

        return self._particleDataHdlrObj
开发者ID:JeffRoy,项目名称:mi-dataset,代码行数:15,代码来源:flort_dj_dcl_telemetered_driver.py


示例15: process

    def process(self):
        log = get_logger()

        with open(self._source_file_path, "rb") as file_handle:
            def exception_callback(exception):
                log.debug("Exception: %s", exception)
                self._particle_data_handler.setParticleDataCaptureFailure()

            parser = OptaaDjDclParser(self._parser_config,
                                      file_handle, exception_callback, self._source_file_path, True)

            driver = DataSetDriver(parser, self._particle_data_handler)

            driver.processFileStream()

        return self._particle_data_handler
开发者ID:danmergens,项目名称:mi-instrument,代码行数:16,代码来源:optaa_dj_dcl_telemetered_driver.py


示例16: process

    def process(self):
        
        log = get_logger()
        
        def exception_callback(exception):
            log.debug("ERROR: %r", exception)
            self._particleDataHdlrObj.setParticleDataCaptureFailure()

        with open(self._sourceFilePath, 'r') as stream_handle:
            parser = CgCpmEngCpmParser(self._parser_config, stream_handle,
                                       exception_callback)
            
            driver = DataSetDriver(parser, self._particleDataHdlrObj)
            driver.processFileStream()    
        
        return self._particleDataHdlrObj
开发者ID:GrimJ,项目名称:mi-dataset,代码行数:16,代码来源:cg_cpm_eng_cpm_common_driver.py


示例17: process

    def process(self):
        
        log = get_logger()
        
        def exception_callback(exception):
            log.debug("ERROR: " + exception)
            self._particleDataHdlrObj.setParticleDataCaptureFailure()

        with open(self._sourceFilePath, 'rb') as stream_handle:
            parser = CgStcEngStcParser(self._parser_config, None, stream_handle,
                                        lambda state, ingested: None,
                                        lambda data: None, exception_callback)
            
            driver = DataSetDriver(parser, self._particleDataHdlrObj)
            driver.processFileStream()    
        
        return self._particleDataHdlrObj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:17,代码来源:cg_stc_eng_stc_common_driver.py


示例18: process

    def process(self):
        log = get_logger()

        def exception_callback(exception):
            log.debug("ERROR: %r", exception)
            self._particleDataHdlrObj.setParticleDataCaptureFailure()

        pathList = (self._sourceFilePath.split('/'))
        filename = pathList[len(pathList) - 1]

        with open(self._sourceFilePath, 'rb') as stream_handle:
            parser = MopakODclParser(self._parser_config, stream_handle,
                                     filename, exception_callback)

            driver = DataSetDriver(parser, self._particleDataHdlrObj)
            driver.processFileStream()

        return self._particleDataHdlrObj
开发者ID:JeffRoy,项目名称:mi-dataset,代码行数:18,代码来源:mopak_o_dcl_common_driver.py


示例19: process

    def process(self):
        """
        Process a file by opening the file and instantiating a parser and driver
        @return: processed particle data handler object
        """
        log = get_logger()

        with open(self._sourceFilePath, "r") as file_handle:
            def exception_callback(exception):
                log.warn("Exception: %s", exception)
                self._particleDataHdlrObj.setParticleDataCaptureFailure()

            # instantiate the parser
            parser = WavssADclParser(file_handle, exception_callback, True)
            # instantiate the driver
            driver = DataSetDriver(parser, self._particleDataHdlrObj)
            # start the driver processing the file
            driver.processFileStream()

        return self._particleDataHdlrObj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:20,代码来源:wavss_a_dcl_telemetered_driver.py


示例20: process

    def process(self):
        log = get_logger()

        with open(self._sourceFilePath, "r") as file_handle:
            def exception_callback(exception):
                log.debug("Exception: %s", exception)
                self._particleDataHdlrObj.setParticleDataCaptureFailure()

            parser = SpkirAbjDclTelemeteredParser(self._parser_config,
                                                  file_handle,
                                                  None,
                                                  lambda state, ingested: None,
                                                  lambda data: None,
                                                  exception_callback)

            driver = DataSetDriver(parser, self._particleDataHdlrObj)

            driver.processFileStream()

        return self._particleDataHdlrObj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:20,代码来源:spkir_abj_dcl_telemetered_driver.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mi_logger.info函数代码示例发布时间:2022-05-27
下一篇:
Python log.debug函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap