How to use setup_hypercorn_logger method in localstack

Best Python code snippet using localstack_python

setup.py

Source:setup.py Github

copy

Full Screen

...74 logging.root.setLevel(log_level)75 logging.getLogger("localstack").setLevel(log_level)76 for logger, level in default_log_levels.items():77 logging.getLogger(logger).setLevel(level)78def setup_hypercorn_logger(hypercorn_config) -> None:79 """80 Sets the hypercorn loggers, which are created in a peculiar way, to the localstack settings.81 :param hypercorn_config: a hypercorn.Config object82 """83 logger = hypercorn_config.log.access_logger84 if logger:85 logger.handlers[0].addFilter(AddFormattedAttributes())86 logger.handlers[0].setFormatter(DefaultFormatter())87 logger = hypercorn_config.log.error_logger88 if logger:89 logger.handlers[0].addFilter(AddFormattedAttributes())...

Full Screen

Full Screen

edge.py

Source:edge.py Github

copy

Full Screen

...12 from localstack.logging.setup import setup_hypercorn_logger13 from localstack.services.generic_proxy import GenericProxy, install_predefined_cert_if_available14 # build server config15 config = Config()16 setup_hypercorn_logger(config)17 if isinstance(bind_address, str):18 bind_address = [bind_address]19 config.bind = [f"{addr}:{port}" for addr in bind_address]20 if use_ssl:21 install_predefined_cert_if_available()22 _, cert_file_name, key_file_name = GenericProxy.create_ssl_cert(serial_number=port)23 config.certfile = cert_file_name24 config.keyfile = key_file_name25 # build gateway26 loop = asyncio.new_event_loop()27 app = AsgiGateway(LocalstackAwsGateway(SERVICE_PLUGINS), event_loop=loop)28 # start serving gateway29 server = HypercornServer(app, config, loop)30 server.start()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful