File tree Expand file tree Collapse file tree 3 files changed +35
-9
lines changed Expand file tree Collapse file tree 3 files changed +35
-9
lines changed Original file line number Diff line number Diff line change 1+
2+ [ ![ Tests on Linux, MacOS and Windows] ( https://github.com/bep/log/workflows/Test/badge.svg )] ( https://github.com/bep/log/actions?query=workflow:Test )
3+ [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/bep/log )] ( https://goreportcard.com/report/github.com/bep/log )
4+ [ ![ GoDoc] ( https://godoc.org/github.com/bep/log?status.svg )] ( https://godoc.org/github.com/bep/log )
5+
6+ This is a fork of the exellent [ Apex Log] ( https://github.com/apex/log ) library.
7+
8+ Main changes:
9+
10+ * Trim unneeded dependencies.
11+ * Make ` Fields ` into a slice to preserve log order.
12+ * Split ` Entry ` into ` Entry ` and ` EntryFields ` . This is easier to reason about and more effective (see benchmarks below)
13+
14+ The existing benchmarks compared to the ` 7e0ed94172ec33f01a921811762c99e93d531cf6 ` :
15+
16+ ``` bash
17+ name old time/op new time/op delta
18+ Logger_small-10 108ns ± 0% 75ns ± 0% -30.54% (p=0.029 n=4+4)
19+ Logger_medium-10 338ns ± 0% 175ns ± 0% -48.17% (p=0.029 n=4+4)
20+ Logger_large-10 1.11µs ± 0% 0.41µs ± 0% -62.92% (p=0.029 n=4+4)
21+
22+ name old alloc/op new alloc/op delta
23+ Logger_small-10 272B ± 0% 96B ± 0% -64.71% (p=0.029 n=4+4)
24+ Logger_medium-10 904B ± 0% 312B ± 0% -65.49% (p=0.029 n=4+4)
25+ Logger_large-10 2.47kB ± 0% 1.26kB ± 0% -49.15% (p=0.029 n=4+4)
26+
27+ name old allocs/op new allocs/op delta
28+ Logger_small-10 3.00 ± 0% 2.00 ± 0% -33.33% (p=0.029 n=4+4)
29+ Logger_medium-10 7.00 ± 0% 5.00 ± 0% -28.57% (p=0.029 n=4+4)
30+ Logger_large-10 19.0 ± 0% 10.0 ± 0% -47.37% (p=0.029 n=4+4)
31+ ```
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ import (
99)
1010
1111// assert interface compliance.
12- var _ Interface = (* EntryFields )(nil )
12+ var (
13+ _ Interface = (* EntryFields )(nil )
14+ _ Interface = (* Entry )(nil )
15+ )
1316
1417// Now returns the current time.
1518var Now = time .Now
You can’t perform that action at this time.
0 commit comments