Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No logger output for Python 3 invoke local #6600

Open
revmischa opened this issue Aug 27, 2019 · 1 comment
Open

No logger output for Python 3 invoke local #6600

revmischa opened this issue Aug 27, 2019 · 1 comment

Comments

@revmischa
Copy link
Contributor

When I run sls invoke local... for my python project I see output when it imports everything and the return value but nothing during the function invocation that is written to logger.

I'm just using log = logging.getLogger(__name__)
and then log.info(), log.error(), etc.
I do see output from print()

I tried adding a logging.basicConfig(level=logging.DEBUG) too but no dice.

@shariffy
Copy link

shariffy commented Sep 9, 2020

I believe it's due to this commit.
Although the commit message could be clearer (or a comment added), I think the purpose is to replicate how Lambda already calls basicConfig.

So, in your example, basicConfig is invoked a second time on the root logger and gets ignored.
To get around it, as per Lambda docs, you can however call log.setLevel(logging.DEBUG) and that seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants