charmbracelet / log

A minimal, colorful Go logging library 🪵
MIT License
2.4k stars 67 forks source link

feat(log): add format methods #33

Closed aymanbagabas closed 1 year ago

aymanbagabas commented 1 year ago

Adds Debugf, Infof, Warnf, Errorf, Fatalf, and Printf. Use these in conjunction with With(...) to add more context to the log. log.With("err", err).Errorf("user %s", user)

Fixes: https://github.com/charmbracelet/log/issues/32

codecov[bot] commented 1 year ago

Codecov Report

Merging #33 (635885f) into main (5315620) will increase coverage by 6.92%. The diff coverage is 80.76%.

@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
+ Coverage   69.60%   76.52%   +6.92%     
==========================================
  Files          11       11              
  Lines         579      605      +26     
==========================================
+ Hits          403      463      +60     
+ Misses        161      128      -33     
+ Partials       15       14       -1     
Impacted Files Coverage Δ
logger.go 86.51% <61.53%> (+7.12%) :arrow_up:
pkg.go 89.28% <100.00%> (+24.49%) :arrow_up:
text.go 60.34% <0.00%> (+3.44%) :arrow_up:
styles.go 85.71% <0.00%> (+14.28%) :arrow_up:

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

tmm1 commented 1 year ago

Happy to see this getting added!