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

Output is not machine-readble and written to stderr #47

Open
loganlinn opened this issue Sep 29, 2021 · 2 comments
Open

Output is not machine-readble and written to stderr #47

loganlinn opened this issue Sep 29, 2021 · 2 comments

Comments

@loganlinn
Copy link

I installed this tool for the first time and wanted to share some usability issues I had.

  1. Command output is written to stderr. Expected: output is written to stdout. The 12 Factor CLI Apps blog post provides guidance on utilizing std input/output streams in a predictable manner.
  2. Command output is a log message. Expected: commands that produce JSON/YAML data should be written directly to output stream rather than through a log formatter.

Addressing this behavior would significantly improve the utility of this tool, especially for scripting and automation.

@dmitry-mightydevops
Copy link

dmitry-mightydevops commented Apr 2, 2022

➜ opsgenie listAlerts --pretty
2022/04/01 20:10:37 INFO: Logging to file is disabled, To enable Logging to file Please specify logPath in configuration
INFO[2022-04-01T20:10:37.946970039-05:00] Client is configured with ApiUrl: api.opsgenie.com, LogLevel: info, RetryMaxCount: 4 
2022/04/01 20:10:38 INFO : [
    {
        "seen": true,
        "id": "31577003-f296-4e07-9069-747b5860282b-1648854679986",
        "tinyId": "6",
        "alias": "09ceb662-b2e8-4f43-9741-15413211db3e_6f52fa37-1fff-4019-a5c9-1e755ed70a84",
        "message": "test incident 1",

I can't believe it's displayed as a log entry :) how am I supposed to apply jq or yq?

setting up config file with something like this: logLevel=error has no effect.

@dustinschultz
Copy link

In the config file, put

lamp.log.level=error

and that will suppress the default INFO log statement so you can pipe it to jq

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

No branches or pull requests

3 participants