terramate icon indicating copy to clipboard operation
terramate copied to clipboard

chore:logging: improve fatal msgs

Open katcipis opened this issue 2 years ago • 1 comments

The idea is to improve logging of fatal msgs. We added functions to help logging our Terramate specific errors more nicely, so when we have error lists (like when parsing failed) it will log each error on its own log entry with the error level, so we don't lose information but we also don't have a clobbered single fatal message.

A parsing error when doing vendoring for example:

terramate experimental vendor download github.com/mineiros-io/terramate main
2022-10-13T15:19:54+02:00 ERR terramate schema error: unrecognized block "wrong"
2022-10-13T15:19:54+02:00 ERR terramate schema error: unrecognized block "wrong2"
2022-10-13T15:19:54+02:00 FTL parsing vendor dir configuration on .terramate

It shows all the parsing errors and then a final fatal with the message. Also added a function to be used for warnings but will change warnings in a different PR later.

katcipis avatar Oct 12 '22 22:10 katcipis

Codecov Report

Base: 71.48% // Head: 71.78% // Increases project coverage by +0.29% :tada:

Coverage data is based on head (1ca5b90) compared to base (ad73e80). Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #643      +/-   ##
==========================================
+ Coverage   71.48%   71.78%   +0.29%     
==========================================
  Files          59       60       +1     
  Lines       10946    10901      -45     
==========================================
  Hits         7825     7825              
+ Misses       2783     2739      -44     
+ Partials      338      337       -1     
Flag Coverage Δ
tests 71.78% <0.00%> (+0.29%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/terramate/cli/cli.go 4.20% <0.00%> (+0.35%) :arrow_up:
errors/errlog/errlog.go 0.00% <0.00%> (ø)
git/git.go 74.36% <0.00%> (-0.34%) :arrow_down:
stack/clone.go 75.22% <0.00%> (+1.76%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

codecov[bot] avatar Oct 12 '22 22:10 codecov[bot]