Skip to content

Commit 5c4edb1

Browse files
committed
wip
Signed-off-by: Armando Ruocco <[email protected]>
1 parent 092d91d commit 5c4edb1

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

pkg/log/log.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"runtime"
2626

2727
"github.com/go-logr/logr"
28-
"go.uber.org/zap/zapcore"
2928
ctrl "sigs.k8s.io/controller-runtime"
3029
ctrlLog "sigs.k8s.io/controller-runtime/pkg/log"
3130
)
@@ -34,27 +33,27 @@ const (
3433
// ErrorLevelString is the string representation of the error level
3534
ErrorLevelString = "error"
3635
// ErrorLevel is the error level priority
37-
ErrorLevel = zapcore.ErrorLevel
36+
ErrorLevel = 5
3837

3938
// InfoLevelString is the string representation of the info level
4039
InfoLevelString = "info"
4140
// InfoLevel is the info level priority
42-
InfoLevel = zapcore.InfoLevel
41+
InfoLevel = 3
4342

4443
// DebugLevelString is the string representation of the debug level
4544
DebugLevelString = "debug"
4645
// DebugLevel is the debug level priority
47-
DebugLevel zapcore.Level = -2
46+
DebugLevel = 2
4847

4948
// TraceLevelString is the string representation of the trace level
5049
TraceLevelString = "trace"
5150
// TraceLevel is the trace level priority
52-
TraceLevel zapcore.Level = -4
51+
TraceLevel = 1
5352

5453
// WarningLevelString is the string representation of the warning level
5554
WarningLevelString = "warning"
5655
// WarningLevel is the warning level priority
57-
WarningLevel = zapcore.WarnLevel
56+
WarningLevel = 4
5857

5958
// DefaultLevelString is the string representation of the default level
6059
DefaultLevelString = InfoLevelString
@@ -122,23 +121,23 @@ func (l *logger) Enabled() bool {
122121
}
123122

124123
func (l *logger) Error(err error, msg string, keysAndValues ...interface{}) {
125-
l.enrich(false).V(int(-ErrorLevel)).Error(err, msg, keysAndValues...)
124+
l.enrich(false).V(int(ErrorLevel)).Error(err, msg, keysAndValues...)
126125
}
127126

128127
func (l *logger) Info(msg string, keysAndValues ...interface{}) {
129-
l.enrich(false).V(int(-InfoLevel)).Info(msg, keysAndValues...)
128+
l.enrich(false).V(int(InfoLevel)).Info(msg, keysAndValues...)
130129
}
131130

132131
func (l *logger) Warning(msg string, keysAndValues ...interface{}) {
133-
l.enrich(false).V(int(-WarningLevel)).Info(msg, keysAndValues...)
132+
l.enrich(false).V(int(WarningLevel)).Info(msg, keysAndValues...)
134133
}
135134

136135
func (l *logger) Debug(msg string, keysAndValues ...interface{}) {
137-
l.enrich(true).V(int(-DebugLevel)).Info(msg, keysAndValues...)
136+
l.enrich(true).V(int(DebugLevel)).Info(msg, keysAndValues...)
138137
}
139138

140139
func (l *logger) Trace(msg string, keysAndValues ...interface{}) {
141-
l.enrich(true).V(int(-TraceLevel)).Info(msg, keysAndValues...)
140+
l.enrich(true).V(int(TraceLevel)).Info(msg, keysAndValues...)
142141
}
143142

144143
func (l *logger) WithValues(keysAndValues ...interface{}) Logger {

0 commit comments

Comments
 (0)