8000 Bug: programmatically changing the log level fails · Issue #2303 · aws-powertools/powertools-lambda-python · GitHub
[go: up one dir, main page]

Skip to content
Bug: programmatically changing the log level fails #2303
Closed
@paulsuh

Description

@paulsuh

Expected Behaviour

When changing the log level of a Logger via code, the log level should be changed.

from aws_lambda_powertools import Logger
powertools_logger = Logger()
powertools_logger.setLevel("DEBUG")    # the log level should become DEBUG
powertools_logger.debug("Hello, world!")    # this should produce a log message

Current Behaviour

When changing the log level of a Logger via code, the log level is not changed.

from aws_lambda_powertools import Logger
powertools_logger = Logger()
powertools_logger.setLevel("DEBUG")    # the log level remains at the default, INFO
powertools_logger.debug("Hello, world!")    # no log message comes out

Code snippet

See above, also the linked repo below

Possible Solution

No response

Steps to Reproduce

See https://github.com/paulsuh/aws-powertools-logging-test-sam for detailed test cases and output.

AWS Lambda Powertools for Python version

latest

AWS Lambda function runtime

3.9

Packaging format used

Serverless Application Repository (SAR) App

Debugging logs

No response

Metadata

Metadata

Labels

bugSomething isn't workinglogger

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0