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

Drop Notice logs when rendering as json? #124

Open
waipeng opened this issue Dec 12, 2024 · 0 comments
Open

Drop Notice logs when rendering as json? #124

waipeng opened this issue Dec 12, 2024 · 0 comments

Comments

@waipeng
Copy link

waipeng commented Dec 12, 2024

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.34.0
  • Ruby: 2.7.8
  • Distribution: Ubuntu 22.04.5 LTS
  • Module version: 4.1.0

How to reproduce (e.g Puppet code you use)

 puppet catalog diff --confdir /etc/puppetlabs/puppet --render-as json puppet:/enva puppet:/envb --node_list server1.example.com                                                                                                                                                                                                    
Notice: Add --debug for realtime output, add --render-as {json,yaml} for parsed output                                                                                                                                
Notice: Add --debug for realtime output, add --render-as {json,yaml} for parsed output                                                                                                                               
{"server1.example.com":{"old_version":"1733993846","new_version":"1733993829","old_environment":"enva","new_environment":"envb", ...}                 

(server hostname and environment names have been changed to protect the innocent)

What are you seeing

Notice: logs, before the json, which makes it hard to dump the output to a json parser

What behaviour did you expect instead

Just json

Output log

Any additional information you'd like to impart

I would like to have catalog diff as part of CI / CD workflow, taking the json output from this and parsing it and displaying the diffs to users. However, there is an annoying Notice debug log which makes it hard for such a workflow (It can be worked around, of course).

I am wondering if I am calling it wrongly, should I have redirected logs to somewhere else? Trying --logdest didn't work.

Alternatively, can such Notice be dropped in a --render-as (or even totally) so as not to pollute the output? I don't see this message as particularly useful, users who need info should be able to use puppet catalog diff --help.

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

1 participant