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


Python boto3.set_stream_logger方法代码示例

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


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

示例1: get

# 需要导入模块: import boto3 [as 别名]
# 或者: from boto3 import set_stream_logger [as 别名]
def get(self, path=""):
        """
        Takes a path and returns lists of files/objects
        and directories/prefixes based on the path.
        """

        boto3.set_stream_logger("boto3.resources", logging.DEBUG)
        boto3.set_stream_logger("botocore", logging.DEBUG)
        try:
            if not self.s3:
                self.s3 = S3Resource(self.config).s3_resource
            result = get_s3_objects_from_path(self.s3, path)
        except S3ResourceNotFoundException as e:
            print(e)
            result = {
                "error": 404,
                "message": "The requested resource could not be found.",
            }
        except Exception as e:
            print(e)
            result = {"error": 500, "message": str(e)}

        self.finish(json.dumps(result)) 
开发者ID:IBM,项目名称:jupyterlab-s3-browser,代码行数:25,代码来源:__init__.py

示例2: session

# 需要导入模块: import boto3 [as 别名]
# 或者: from boto3 import set_stream_logger [as 别名]
def session(self):
        '''Get a low-level session object or create one if needed'''
        if not self._session:
            if self.config.debug_mode:
                boto3.set_stream_logger(level=log.DEBUG)
            self._session = boto3.session.Session(
                region_name=self.region_name, **self.session_cfg)
        return self._session 
开发者ID:CloudVE,项目名称:cloudbridge,代码行数:10,代码来源:provider.py

示例3: sync

# 需要导入模块: import boto3 [as 别名]
# 或者: from boto3 import set_stream_logger [as 别名]
def sync(config, parameter, suffix, debug, confirm, yes):
    confirm = confirm or yes
    if debug:
        LOGGER.setLevel(logging.DEBUG)
        boto3.set_stream_logger(name='boto3', level=logging.DEBUG)
        boto3.set_stream_logger(name='botocore', level=logging.DEBUG)
    else:
        LOGGER.setLevel(logging.INFO)

    if confirm:
        LOGGER.info("This action will modify AWS infrastructure in account: {0}".format(
            get_first_account_alias_or_account_id()))
    else:
        check_update_available()
        click.confirm('This action will modify AWS infrastructure in account: {0}\nAre you sure?'.format(
            get_first_account_alias_or_account_id()), abort=True)

    try:

        config = Config(config_file=config, cli_params=parameter, stack_name_suffix=suffix)
        StackActionHandler(config).create_or_update_stacks()
    except CfnSphereException as e:
        LOGGER.error(e)
        if debug:
            LOGGER.exception(e)
        sys.exit(1)
    except Exception as e:
        LOGGER.error("Failed with unexpected error")
        LOGGER.exception(e)
        LOGGER.info("Please report at https://github.com/cfn-sphere/cfn-sphere/issues!")
        sys.exit(1) 
开发者ID:cfn-sphere,项目名称:cfn-sphere,代码行数:33,代码来源:cli.py

示例4: __init__

# 需要导入模块: import boto3 [as 别名]
# 或者: from boto3 import set_stream_logger [as 别名]
def __init__(self, region, retries=100):
        boto3.set_stream_logger('boto3', logging.INFO)
        self.session = boto3.Session()
        self.region = region
        self.retries = retries
        self._ec2_client = None
        self._ec2_resource = None
        self._cloudwatch_client = None
        self._iam_client = None 
开发者ID:zalando-nakadi,项目名称:bubuku,代码行数:11,代码来源:__init__.py

示例5: experiment_obj

# 需要导入模块: import boto3 [as 别名]
# 或者: from boto3 import set_stream_logger [as 别名]
def experiment_obj(sagemaker_boto_client):
    description = "{}-{}".format("description", str(uuid.uuid4()))
    boto3.set_stream_logger("", logging.INFO)
    experiment_obj = experiment.Experiment.create(
        experiment_name=name(), description=description, sagemaker_boto_client=sagemaker_boto_client
    )
    yield experiment_obj
    time.sleep(0.5)
    experiment_obj.delete() 
开发者ID:aws,项目名称:sagemaker-experiments,代码行数:11,代码来源:conftest.py


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