mattermost / mattermost-plugin-apps

Powers the Mattermost App Framework
https://developers.mattermost.com/integrate/apps/
Apache License 2.0
34 stars 29 forks source link

[MM-48533] Enable color logs #395

Closed hanzei closed 1 year ago

hanzei commented 1 year ago

Summary

This PR adds two improvments for appscl.

  1. The log output is now colored.
  2. Add a --version flag.
  3. Instead of printing a fantal error two times, the error is only printed once, making it more readable.
Old
$ go run . aws clean
Error: no AWS access key was provided. Please set MM_APPS_DEPLOY_AWS_ACCESS_KEY
Usage:
  appsctl aws clean [flags]

Flags:
  -h, --help   help for clean

Global Flags:
  -q, --quiet     quiet (errors only) output
  -v, --verbose   verbose (debug) output

2022-11-21T16:54:35.336+0100    FATAL   appsctl/main.go:38  command failed  {"error": "no AWS access key was provided. Please set MM_APPS_DEPLOY_AWS_ACCESS_KEY"}
main.main
    /home/bschumacher/src/mattermost/plugins/apps/cmd/appsctl/main.go:38
runtime.main
    /usr/local/go/src/runtime/proc.go:250
exit status 1
New
$ go run . aws clean
Error: no AWS access key was provided. Please set MM_APPS_DEPLOY_AWS_ACCESS_KEY
Usage:
  appsctl aws clean [flags]

Flags:
  -h, --help   help for clean

Global Flags:
  -q, --quiet     quiet (errors only) output
  -v, --verbose   verbose (debug) output

Ticket Link

https://mattermost.atlassian.net/browse/MM-48533

codecov-commenter commented 1 year ago

Codecov Report

Base: 21.13% // Head: 21.12% // Decreases project coverage by -0.00% :warning:

Coverage data is based on head (3710c81) compared to base (95d2107). Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #395 +/- ## ========================================== - Coverage 21.13% 21.12% -0.01% ========================================== Files 81 81 Lines 5215 5216 +1 ========================================== Hits 1102 1102 - Misses 3999 4000 +1 Partials 114 114 ``` | [Impacted Files](https://codecov.io/gh/mattermost/mattermost-plugin-apps/pull/395?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost) | Coverage Δ | | |---|---|---| | [utils/logger.go](https://codecov.io/gh/mattermost/mattermost-plugin-apps/pull/395/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost#diff-dXRpbHMvbG9nZ2VyLmdv) | `0.00% <0.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.