Skip to content

Commit d59e561

Browse files
authored
Merge pull request #1231 from sirupsen/dbd-cleanup
cleanup
2 parents 15ca3c0 + 35ab8d8 commit d59e561

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1+
# 1.8.0
2+
3+
Correct versioning number replacing v1.7.1.
4+
15
# 1.7.1
6+
7+
Beware this release has introduced a new public API and its semver is therefore incorrect.
8+
29
Code quality:
310
* use go 1.15 in travis
411
* use magefile as task runner

entry.go

+5-13
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ func (entry *Entry) Dup() *Entry {
8888

8989
// Returns the bytes representation of this entry from the formatter.
9090
func (entry *Entry) Bytes() ([]byte, error) {
91-
return entry.bytes_nolock()
92-
}
93-
94-
func (entry *Entry) bytes_nolock() ([]byte, error) {
9591
return entry.Logger.Formatter.Format(entry)
9692
}
9793

@@ -222,8 +218,6 @@ func (entry Entry) HasCaller() (has bool) {
222218
entry.Caller != nil
223219
}
224220

225-
// This function is not declared with a pointer value because otherwise
226-
// race conditions will occur when using multiple goroutines
227221
func (entry *Entry) log(level Level, msg string) {
228222
var buffer *bytes.Buffer
229223

@@ -279,13 +273,11 @@ func (entry *Entry) write() {
279273
fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
280274
return
281275
}
282-
func() {
283-
entry.Logger.mu.Lock()
284-
defer entry.Logger.mu.Unlock()
285-
if _, err := entry.Logger.Out.Write(serialized); err != nil {
286-
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
287-
}
288-
}()
276+
entry.Logger.mu.Lock()
277+
defer entry.Logger.mu.Unlock()
278+
if _, err := entry.Logger.Out.Write(serialized); err != nil {
279+
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
280+
}
289281
}
290282

291283
func (entry *Entry) Log(level Level, args ...interface{}) {

0 commit comments

Comments
 (0)