Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Don't log verbose by default #1

Open
vidister opened this issue Jun 12, 2023 · 1 comment
Open

Don't log verbose by default #1

vidister opened this issue Jun 12, 2023 · 1 comment

Comments

@vidister
Copy link
Member

vidister commented Jun 12, 2023

Current behavior:
rcli always logs to stdout. This makes parsing the structured output a pain.

rcli exec -o json device.example.com "show interface" | jq .
parse error: Invalid numeric literal at line 1, column 15

Expected behavior:

Option 1:

  • Don't log info/verbose by default
  • When -v or --verbose is set, log to stderr
  • always log errors to stderr

This is equivalent to the behavior of curl.

Option 2:

  • Only log to stdout when no pipe is attached to stdout
    • can be checked using os.ModeCharDevice
  • errors log to stderr

I prefer Option 1.

@vidister
Copy link
Member Author

Nevermind, apparently there was an old version of the flake pinned in our repo. The current main logs to stderr.
This reduces the scope of the issue to:

  • Only log anything else then error when -v/--version is set.

@vidister vidister changed the title Don't log to stdout by default Don't log verbose by default Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant