Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This fix allows stdout to be logged to the console, allowing Ruby output operations like
logger.info
,puts
andp
to materialize.Emulates the way
sls invoke local --function ...
logs such statements.Motivation and Context
The use of
logger
is officially supported by AWS in Lambda, and should produce the same result when running offline. It is also useful to be able to print to console for debugging purposes. The implementation of the Python runner does a similar thing.Resolves #1206
How Has This Been Tested?
I installed and built the local fork into my project and added the following print statements
Output was
Built locally using package.json and compiled using Babel per the contribution guide.
Please let me know if you have any questions or if there is something I missed. Thanks!
Screenshots (if appropriate):