We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c2f0318 + 31eff16 commit 3a9983aCopy full SHA for 3a9983a
logging/logging.go
@@ -117,3 +117,14 @@ func (l *Logging) GetChildLogger(name string) *Logger {
117
func (l *Logging) GetLogger() *Logger {
118
return l.logger
119
}
120
+
121
+// ForceLog results in every message being logged.
122
+//
123
+// This [zap.Option] is the opposite of [zap.IncreaseLevel], it just decreases the log level to debug. Since zap's
124
+// architecture does not allow this with the same [zapcore.Core], it replaces the core with a freshly created one from
125
+// the Logging's core factory.
126
+func (l *Logging) ForceLog() zap.Option {
127
+ return zap.WrapCore(func(_ zapcore.Core) zapcore.Core {
128
+ return l.coreFactory(zap.NewAtomicLevelAt(zapcore.DebugLevel))
129
+ })
130
+}
0 commit comments