Cap-go / CLI

CLI to help you to manage your version in capgo cloud
https://capgo.app
GNU Affero General Public License v3.0
14 stars 35 forks source link

Add json logger #199

Closed fxsalazar closed 6 months ago

fxsalazar commented 9 months ago

Abstraction of the json logs.

My motivation was to avoid printing the checkLatest warning when --json

sonarcloud[bot] commented 9 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

fxsalazar commented 7 months ago

👀 any news for this PR?

fxsalazar commented 6 months ago

@riderx can it be possible to at least avoid printing the checkLatest when using --json

riderx commented 6 months ago

Sorry it seems i closed wrongly, i check it again

riderx commented 6 months ago

hey @fxsalazar i'm not sure to understand why create a logger class for just one usage different form printing ? why not calling your function at the only place it's required?

riderx commented 6 months ago

Thanks a lot for trying, I just made a solution i was finding simpler: https://github.com/Cap-go/CLI/commit/540363461a6d2410e8e3130d70a0b0def2186c9f

fxsalazar commented 6 months ago

For abstraction; instead of checking everywhere you wan to print if (!json), let the Logger handle how to do the logging.

riderx commented 6 months ago

This option is only available in one place, and if the message is not print there is no need to call checkLatest so i went the simple way and add one more if instead :)