-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
support --log / -l for invoke local (especially for Python logging) #4147
Comments
I don't quite follow what you're asking for. Here's the
and using the python
|
@dschep mine behavior is different: def search(event, context):
logger = logging.getLogger('posts')
logger.setLevel(logging.DEBUG)
logger.info('log INFO event: %s', event)
logger.error('log ERROR event: %s', event)
print('print event: %s' % event) Result:
|
@ceefour, that's odd. I'm not sure why it'd be doing that 😕 |
@dschep there is light: def search(event, context):
logger = logging.getLogger('posts')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
logger.addHandler(ch)
logger.info('log INFO event: %s', event)
logger.error('log ERROR event: %s', event)
print('print event: %s' % event) gives:
which is kinda acceptable if I'm so inclined. But I don't get why I have to do so much boilerplate while you (and AWS) can get sane nice defaults ? Perhaps this is not so much request for |
Hmm. I'm guessing AWS does something in their python code before it imports and calls your handler, |
Feature Proposal
Description
Currently Python logging doesn't output anything using invoke local
Add logging support similar to
invoke -l
Especially with Python logging
I'd argue that --log for invoke local should be enabled by default, rather than needing to be enabled explicitly.
Additional Data
The text was updated successfully, but these errors were encountered: