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

Differentiate sls invoke response from logging to allow piping result #4675

Open
mvayngrib opened this issue Jan 22, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@mvayngrib
Copy link
Contributor

commented Jan 22, 2018

This is a Feature Proposal

Description

problem:
when you run sls invoke, both the invocation response and logs are written to the console with console.log (stdout). This makes it hard to differentiate the invocation response from logging, and makes piping the command impossible.

potential solutions:

  • log to stderr, write the invocation response to stdout.
  • accept an --output option, and write the response to the provided file path

@mvayngrib mvayngrib changed the title differentiate invoke response from invoke logging to allow piping result differentiate sls invoke response from loggins to allow piping result Jan 22, 2018

@mvayngrib mvayngrib changed the title differentiate sls invoke response from loggins to allow piping result differentiate sls invoke response from logging to allow piping result Jan 22, 2018

@HyperBrain

This comment has been minimized.

Copy link
Member

commented Jan 22, 2018

We should fix the correct output stream for errors to stderr (see my comment in #4673 )
However, the log output belongs to one or the other depending on the log level, e.g. informational logs belong to stdout while error logs do not.

As the results that are logged are in fact data outputs, they should go into stdout (as is), but additionally having --output|-o to redirect the data output would be very beneficial.

@mvayngrib

This comment has been minimized.

Copy link
Contributor Author

commented Jan 22, 2018

@HyperBrain i agree, writing all logs to stderr would be morally wrong :) my vote's for --output as well.

in the current code, invoke output isn't handled in any centralized fashion - there are just console logs sprinkled around. Are there are plans to? It doesn't seem hard to handle --output for invoke, and for invoke local on Node.js. However, the output from local python and java lambdas doesn't seem differentiated

@pmuens pmuens added the cat/dx label Feb 13, 2019

@pmuens pmuens changed the title differentiate sls invoke response from logging to allow piping result Differentiate sls invoke response from logging to allow piping result Feb 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.