Code Monkey home page Code Monkey logo

Comments (7)

navin772 avatar navin772 commented on August 17, 2024 3

This looks good, so the final commands will look something like:
karmor logs --output json
karmor logs --output pretty-json
karmor logs --output text

The --json flag will still be present:
karmor logs --json

And the normal log output:
karmor logs

Right?

from kubearmor-client.

EraKin575 avatar EraKin575 commented on August 17, 2024 3

Hi, @navin772 ! Can I work on this enhancement?

from kubearmor-client.

DelusionalOptimist avatar DelusionalOptimist commented on August 17, 2024 2

This sounds good to me. Though users can use external tools like jq for beautifying but having the ability to do so in karmor itself might come in handy if user doesn't have the tools present.
IMO We can keep the default output as non-beautified and have a --beautify flag which will pretty-print the JSON.
cc @daemon1024 @kranurag7

from kubearmor-client.

DelusionalOptimist avatar DelusionalOptimist commented on August 17, 2024 2

Yes... let's keep the current output and also the --json flag. We can add an --output/-o flag:
--output json - plain json
--output pretty-json - beautified json
--output text - usual text output

from kubearmor-client.

kranurag7 avatar kranurag7 commented on August 17, 2024 1

Agree with Rudraksh here, We also ingest these logs to some logging solutions which will prefer the default that we have now.

For flag I think we can go for something like --format and --output with value of jsonindent or similar something. With this, we can support multiple values in future if required like yaml, table etc. that we have with other CLIs.

from kubearmor-client.

kranurag7 avatar kranurag7 commented on August 17, 2024 1

Don't remove --json that would be a breaking change and we should avoid that.
Adding another value to the flag would be ideal I think.

Edit: We can discuss more on if jsonindent is the name we prefer because it doesn't sound intuitive in my head.

from kubearmor-client.

navin772 avatar navin772 commented on August 17, 2024

So, the final command will look something like karmor logs --output jsonindent replacing the --json flag completely?

This will require a docs update as --json flag is used widely. Thoughts?

from kubearmor-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.