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

Python structured.get_default_logger函数代码示例

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

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



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

示例1: __init__

    def __init__(self, options):
        self.options = options
        self.logger = commandline.setup_logging("mozregression",
                                                self.options,
                                                {"mach": sys.stdout})
        # allow to filter process output based on the user option
        if options.process_output is None:
            # process_output not user defined
            log_process_output = options.build_type != 'opt'
        else:
            log_process_output = options.process_output == 'stdout'
        get_default_logger("process").component_filter = \
            lambda data: data if log_process_output else None

        # filter some mozversion log lines
        re_ignore_mozversion_line = re.compile(
            r"^(platform_.+|application_vendor|application_remotingname"
            r"|application_id|application_display_name): .+"
        )
        get_default_logger("mozversion").component_filter = lambda data: (
            None if re_ignore_mozversion_line.match(data['message']) else data
        )

        self.action = None
        self.fetch_config = None
开发者ID:crisron,项目名称:mozregression-1,代码行数:25,代码来源:cli.py


示例2: __init__

    def __init__(self, device_serial=None):
        self.device_serial = device_serial

        self._logger = structured.get_default_logger(component='b2gmonkey')
        if not self._logger:
            self._logger = mozlog.getLogger('b2gmonkey')

        self.version = mozversion.get_version(
            dm_type='adb', device_serial=device_serial)

        device_id = self.version.get('device_id')
        if not device_id:
            raise B2GMonkeyError('Firefox OS device not found.')

        self.device_properties = DEVICE_PROPERTIES.get(device_id)
        if not self.device_properties:
            raise B2GMonkeyError('Unsupported device: \'%s\'' % device_id)

        android_version = self.version.get('device_firmware_version_release')
        if device_id == 'flame' and android_version == '4.4.2':
            self.device_properties.update(DEVICE_PROPERTIES.get('flame-kk'))

        self.temp_dir = tempfile.mkdtemp()
        if 'MINIDUMP_SAVE_PATH' not in os.environ:
            self.crash_dumps_path = os.path.join(self.temp_dir, 'crashes')
            os.environ['MINIDUMP_SAVE_PATH'] = self.crash_dumps_path
        else:
            self.crash_dumps_path = os.environ['MINIDUMP_SAVE_PATH']
开发者ID:JJTC-PX,项目名称:b2gmonkey,代码行数:28,代码来源:b2gmonkey.py


示例3: __init__

 def __init__(self, test_paths, force_manifest_update=False):
     do_delayed_imports()
     self.test_paths = test_paths
     self.force_manifest_update = force_manifest_update
     self.logger = structured.get_default_logger()
     if self.logger is None:
         self.logger = structured.structuredlog.StructuredLogger("ManifestLoader")
开发者ID:0X1A,项目名称:servo,代码行数:7,代码来源:testloader.py


示例4: run

    def run(cls, version=None):
        logger = get_default_logger()

        try:
            dm = mozdevice.DeviceManagerADB(runAdbAsRoot=True)
        except mozdevice.DMError as e:
            logger.error("Error connecting to device via adb (error: %s). Please be " \
                         "sure device is connected and 'remote debugging' is enabled." % \
                         e.msg)
            raise

        try:
            out = dm.shellCheckOutput(['ls', '-alR', '/'], root=True)
        except mozdevice.DMError as e:
            cls.log_status('FAIL', 'Failed to gather filesystem information from device via adb: %s' % e.msg)
            return False

        found = []
        for f in parse_ls(out):
            if f['perm'][2] == 's' and f['uid'] == 'root':
                if not cls.whitelist_check(f['name']):
                    found.append(f['name'])
        if len(found) > 0:
            cls.log_status('PASS',
                           'Please ensure that the following suid root files are no security risk:\n%s' % '\n'.join(
                               found))
        else:
            cls.log_status('PASS', 'No unexpected suidroot executables found.')

        return True
开发者ID:Predator-Design-Studios,项目名称:fxos-certsuite,代码行数:30,代码来源:filesystem.py


示例5: run

    def run(cls, version=None):
        logger = get_default_logger()

        try:
            device = DeviceHelper.getDevice()
        except ADBError as e:
            logger.error("Error connecting to device via adb (error: %s). Please be " \
                         "sure device is connected and 'remote debugging' is enabled." % \
                         e.msg)
            raise

        try:
            out = device.shell_output('ls -alR /', root=True)
        except ADBError as e:
            cls.log_status('FAIL', 'Failed to gather filesystem information from device via adb: %s' % e.msg)
            return False

        found = []
        for f in parse_ls(out):
            if f['perm'][7] == 'w' and f['mode'] != 'l':
                if not cls.whitelist_check(f['name']):
                    found.append(f['name'])
        if len(found) > 0:
            cls.log_status('PASS',
                           'Please ensure that the following world-writable files will not pose a security risk:\n%s' % '\n'.join(
                               found))
        else:
            cls.log_status('PASS', 'No unexpected suidroot executables found.')

        return True
开发者ID:JJTC-PX,项目名称:fxos-certsuite,代码行数:30,代码来源:filesystem.py


示例6: run

    def run(cls, version=None):
        logger = get_default_logger()

        try:
            ps = b2gps()
        except Exception as e:
            cls.log_status('FAIL', 'Failed to retrieve b2g-ps info: %s' % e)
            return False

        # list of b2g versions that don't have seccomp support
        without_seccomp = ['1.0', '1.1', '1.2', '1.3', '1.3t', '1.4']
        if version is not None and version in without_seccomp:
            cls.log_status('PASS', "Target version %s doesn't support SECCOMP" % version)
            return True

        if not ps.has_known_format():
            cls.log_status('FAIL', "b2g-ps output from device has unknown format")
            return False

        if not ps.seccomp_is_enabled():
            cls.log_status('FAIL', "Please enable SECCOMP support on the device. The B2G version should support it.")
            return False

        if not ps.b2g_uses_seccomp():
            cls.log_status('FAIL', "Gonk has SECCOMP support, but the B2G process doesn't. Please enable.")
            return False

        cls.log_status('PASS', "SECCOMP enabled in Gonk and B2G process")
        return True
开发者ID:JJTC-PX,项目名称:fxos-certsuite,代码行数:29,代码来源:kernel.py


示例7: inner

    def inner(command, *args, **kwargs):
        global logger

        if logger is None:
            logger = get_default_logger("vcs")

        repo = kwargs.pop("repo", None)
        log_error = kwargs.pop("log_error", True)
        if kwargs:
            raise TypeError, kwargs

        args = list(args)

        proc_kwargs = {}
        if repo is not None:
            proc_kwargs["cwd"] = repo

        command_line = [bin_name, command] + args
        logger.debug(" ".join(command_line))
        try:
            return subprocess.check_output(command_line, stderr=subprocess.STDOUT, **proc_kwargs)
        except subprocess.CalledProcessError as e:
            if log_error:
                logger.error(e.output)
            raise
开发者ID:AlanWasTaken,项目名称:servo,代码行数:25,代码来源:vcs.py


示例8: __init__

 def __init__(self, fetch_config, test_runner, options):
     self.fetch_config = fetch_config
     self.options = options
     self.bisector = Bisector(fetch_config, test_runner,
                              persist=options.persist,
                              dl_in_background=options.background_dl)
     self._logger = get_default_logger('Bisector')
开发者ID:askeing,项目名称:mozregression,代码行数:7,代码来源:bisector.py


示例9: run_groups

    def run_groups(groups=[], version=None, host='localhost', port=2828, mode='phone'):
        hasadb = mode == 'phone'
        logger = get_default_logger()
        if groups is None or len(groups) == 0:  # run all groups
            logger.debug('running securitysuite tests for all groups %s' % str(ExtraTest.group_list(mode=mode)))
            groups = ExtraTest.group_list(mode=mode)
        else:
            logger.debug('running securitysuite tests for groups %s' % str(groups))
        logger.suite_start(tests=groups)
        
        # setup marionette before any test
        marionette = DeviceHelper.getMarionette(host=host, port=port)
        # setup device before any test
        device = DeviceHelper.getDevice()

        for g in groups:
            logger.debug("running securitysuite test group %s" % g)
            logger.test_start(g)
            try:
                ExtraTest.run(g, version=version)
                logger.test_end(g, 'OK')
            except:
                logger.critical(traceback.format_exc())
                logger.test_end(g, 'FAIL')
                raise
        logger.suite_end()
开发者ID:JJTC-PX,项目名称:fxos-certsuite,代码行数:26,代码来源:suite.py


示例10: __init__

 def __init__(self, find_fix=False):
     self.find_fix = find_fix
     self.found_repo = None
     self.build_range = None
     self.good_revision = None
     self.bad_revision = None
     self._logger = get_default_logger('Bisector')
开发者ID:pombredanne,项目名称:mozregression,代码行数:7,代码来源:bisector.py


示例11: __init__

 def __init__(self, inbound_branch=None, bits=mozinfo.bits, persist=None):
     self.inbound_branch = inbound_branch
     self.bits = bits
     self.persist = persist
     self.build_regex = self._get_build_regex(self.name, bits) + "$"
     self.build_info_regex = \
         self._get_build_regex(self.name, bits, with_ext=False) + "\.txt$"
     self._logger = get_default_logger('Regression Runner')
开发者ID:andreieftimie,项目名称:mozregression,代码行数:8,代码来源:runnightly.py


示例12: __init__

 def __init__(self, nightly_runner, inbound_runner, appname="firefox",
              last_good_revision=None, first_bad_revision=None):
     self.nightly_runner = nightly_runner
     self.inbound_runner = inbound_runner
     self.appname = appname
     self.last_good_revision = last_good_revision
     self.first_bad_revision = first_bad_revision
     self._logger = get_default_logger('Bisector')
开发者ID:andreieftimie,项目名称:mozregression,代码行数:8,代码来源:regression.py


示例13: __init__

 def __init__(self):
     self.logger = get_default_logger()
     try:
         self.dm = mozdevice.DeviceManagerADB(runAdbAsRoot=True)
     except mozdevice.DMError as e:
         self.logger.error("Error connecting to device via adb (error: %s). Please be "
                           "sure device is connected and 'remote debugging' is enabled." %
                           e.msg)
         raise
开发者ID:Predator-Design-Studios,项目名称:fxos-certsuite,代码行数:9,代码来源:kernel.py


示例14: __init__

 def __init__(self):
     self.logger = get_default_logger()
     try:
         self.device = DeviceHelper.getDevice()
     except ADBError as e:
         self.logger.error("Error connecting to device via adb (error: %s). Please be "
                           "sure device is connected and 'remote debugging' is enabled." %
                           e.msg)
         raise
开发者ID:JJTC-PX,项目名称:fxos-certsuite,代码行数:9,代码来源:kernel.py


示例15: cli

def cli(argv=None):
    """
    main entry point of mozregression command line.
    """
    options = parse_args(argv)
    logger = commandline.setup_logging("mozregression",
                                       options,
                                       {"mach": sys.stdout})
    check_mozregression_version(logger)

    if options.list_releases:
        print(formatted_valid_release_dates())
        sys.exit()

    cache_session = limitedfilecache.get_cache(
        options.http_cache_dir, limitedfilecache.ONE_GIGABYTE,
        logger=get_default_logger('Limited File Cache'))
    set_http_cache_session(cache_session,
                           get_defaults={"timeout": options.http_timeout})

    fetch_config = create_config(options.app, mozinfo.os, options.bits)

    if options.command is None:
        launcher_kwargs = dict(
            addons=options.addons,
            profile=options.profile,
            cmdargs=options.cmdargs,
            preferences=preference(options.prefs_files, options.prefs),
        )
        test_runner = ManualTestRunner(launcher_kwargs=launcher_kwargs)
    else:
        test_runner = CommandTestRunner(options.command)

    runner = ResumeInfoBisectRunner(fetch_config, test_runner, options)

    if fetch_config.is_inbound():
        # this can be useful for both inbound and nightly, because we
        # can go to inbound from nightly.
        fetch_config.set_inbound_branch(options.inbound_branch)

    # bisect inbound if last good revision or first bad revision are set
    if options.first_bad_revision or options.last_good_revision:
        bisect = bisect_inbound
    else:
        bisect = bisect_nightlies

    try:
        launcher_class = APP_REGISTRY.get(fetch_config.app_name)
        launcher_class.check_is_runnable()

        sys.exit(bisect(runner, logger))
    except KeyboardInterrupt:
        sys.exit("\nInterrupted.")
    except UnavailableRelease as exc:
        sys.exit("%s\n%s" % (exc, formatted_valid_release_dates()))
    except (MozRegressionError, RequestException) as exc:
        sys.exit(str(exc))
开发者ID:askeing,项目名称:mozregression,代码行数:57,代码来源:main.py


示例16: __init__

 def __init__(self, test_paths, force_manifest_update=False, manifest_download=False, types=None, meta_filters=None):
     do_delayed_imports()
     self.test_paths = test_paths
     self.force_manifest_update = force_manifest_update
     self.manifest_download = manifest_download
     self.types = types
     self.meta_filters = meta_filters or []
     self.logger = structured.get_default_logger()
     if self.logger is None:
         self.logger = structured.structuredlog.StructuredLogger("ManifestLoader")
开发者ID:Ms2ger,项目名称:web-platform-tests,代码行数:10,代码来源:testloader.py


示例17: __init__

 def __init__(self):
     self.logger = get_default_logger()
     try:
         self.dm = mozdevice.DeviceManagerADB(runAdbAsRoot=True)
     except mozdevice.DMError as e:
         self.logger.error("Error connecting to device via adb (error: %s). Please be " \
                           "sure device is connected and 'remote debugging' is enabled." % \
                           e.msg)
         raise
     self.logger.debug("Attempting to set up port forwarding for marionette")
开发者ID:Predator-Design-Studios,项目名称:fxos-certsuite,代码行数:10,代码来源:ssl.py


示例18: setup_server_logging

    def setup_server_logging(self):
        server_logger = get_default_logger(component="wptserve")
        assert server_logger is not None
        log_filter = handlers.LogLevelFilter(lambda x:x, "info")
        # Downgrade errors to warnings for the server
        log_filter = LogLevelRewriter(log_filter, ["error"], "warning")
        server_logger.component_filter = log_filter

        serve.logger = server_logger
        #Set as the default logger for wptserve
        serve.set_logger(server_logger)
开发者ID:itcms,项目名称:tor-browser,代码行数:11,代码来源:wptrunner.py


示例19: __init__

    def __init__(self, dest, **kwargs):
        self._running = False
        self._stopping = False
        self._logger = get_default_logger('Test Runner')

        try:
            self._install(dest)
        except Exception:
            msg = "Unable to install %r" % dest
            self._logger.error(msg, exc_info=True)
            raise LauncherError(msg)
开发者ID:pombredanne,项目名称:mozregression,代码行数:11,代码来源:launchers.py


示例20: __init__

    def __init__(self, parent):
        self.parent = parent
        self.result_array = []
        self.comment_array = []
        self.init_time = time.time()
        self.test_num = self.parent.parent.__module__[5:]
        self.detail_file = "{}/{}_detail.html".format(self.parent.general.get_config_variable('result_dir', 'output'),
                                                      self.test_num)

        # config_file = self.parent.general.get_config_variable('log_cfg', 'output')
        # logging.config.fileConfig(config_file)
        self.custom_logger = get_default_logger()
开发者ID:owdqa,项目名称:OWD_TEST_TOOLKIT,代码行数:12,代码来源:reporting.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python commandline.add_logging_group函数代码示例发布时间:2022-05-27
下一篇:
Python commandline.setup_logging函数代码示例发布时间: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