Commit a18e1e2
authored
fix: Refactor logger initialization in example_test.go (#580)
This commit refactors the logger initialization in the example_test.go files
for the logr, logrus, and zap interceptors. In each file, the InterceptorLogger
function was modified to create a new logger instance using the original logger
and additional fields passed in as arguments, rather than modifying the original
logger instance. This ensures that subsequent logs using the original logger are not
affected by the additional fields.
The changes were made to the following files:
- interceptors/logging/examples/logr/example_test.go
- interceptors/logging/examples/logrus/example_test.go
- interceptors/logging/examples/zap/example_test.go
Signed-off-by: aimuz <mr.imuz@gmail.com>1 parent 32ae386 commit a18e1e2
File tree
3 files changed
+5
-6
lines changed- interceptors/logging/examples
- logrus
- logr
- zap
3 files changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 36 | + | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
0 commit comments