labstack / gommon

Common packages for Go
MIT License
540 stars 101 forks source link

Remove un-necessary locking (#1) #29

Open jhlange opened 5 years ago

jhlange commented 5 years ago

Remove un-necessary locking in the logging API.

codecov-io commented 5 years ago

Codecov Report

Merging #29 into master will not change coverage. The diff coverage is 73.33%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #29   +/-   ##
=======================================
  Coverage   58.88%   58.88%           
=======================================
  Files           6        6           
  Lines         518      518           
=======================================
  Hits          305      305           
  Misses        210      210           
  Partials        3        3
Impacted Files Coverage Δ
log/log.go 50% <73.33%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 82ef680...5c6c1c9. Read the comment docs.

vishr commented 5 years ago

@jhlange Do we event need a lock for the entire block? I just looked at the code and to me it is only necessary while dumping the buffer to writer. Let me know your thoughts?

Here is a fix: https://github.com/labstack/gommon/commit/44f253335a453f4a087da4574d78ebddbe48634d