-
Notifications
You must be signed in to change notification settings - Fork 0
/
log_debug.go
44 lines (35 loc) · 1.95 KB
/
log_debug.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//go:build !release
// +build !release
package log
func (self *Log) printf(format string, values ...any) {
self.logger.Debug().Fields(self.tags).Str("function", getCallerFunctionName()).Msgf(format, values...)
}
// Perf: Each log function has its own function based on benchmark feedback. Not sure why though.
// nolint:goprintffuncname // reason: keep in line with logger function naming
func (self *Log) trace(format string, values ...any) {
self.logger.Trace().Fields(self.tags).Str("function", getCallerFunctionName()).Msgf(format, values...)
}
// nolint:goprintffuncname // reason: keep in line with logger function naming
func (self *Log) debug(format string, values ...any) {
self.logger.Debug().Fields(self.tags).Str("function", getCallerFunctionName()).Msgf(format, values...)
}
// nolint:goprintffuncname // reason: keep in line with logger function naming
func (self *Log) info(format string, values ...any) {
self.logger.Info().Fields(self.tags).Str("function", getCallerFunctionName()).Msgf(format, values...)
}
// nolint:goprintffuncname // reason: keep in line with logger function naming
func (self *Log) warn(format string, values ...any) {
self.logger.Warn().Fields(self.tags).Str("function", getCallerFunctionName()).Msgf(format, values...)
}
// nolint:goprintffuncname // reason: keep in line with logger function naming
func (self *Log) error(format string, values ...any) {
self.logger.Error().Fields(self.tags).Str("function", getCallerFunctionName()).Msgf(format, values...)
}
// nolint:goprintffuncname // reason: keep in line with logger function naming
func (self *Log) fatal(format string, values ...any) {
self.logger.Fatal().Fields(self.tags).Str("function", getCallerFunctionName()).Msgf(format, values...)
}
// nolint:goprintffuncname // reason: keep in line with logger function naming
func (self *Log) panic(format string, values ...any) {
self.logger.Panic().Fields(self.tags).Str("function", getCallerFunctionName()).Msgf(format, values...)
}