Add standard and structured logging methods to enhance logging capabilities
This commit is contained in:
@@ -33,6 +33,11 @@ func Init(level string, filePath string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Standard logging methods
|
||||||
|
func Debug(args ...interface{}) {
|
||||||
|
log.Debug(args...)
|
||||||
|
}
|
||||||
|
|
||||||
func Info(args ...interface{}) {
|
func Info(args ...interface{}) {
|
||||||
log.Info(args...)
|
log.Info(args...)
|
||||||
}
|
}
|
||||||
@@ -41,14 +46,11 @@ func Error(args ...interface{}) {
|
|||||||
log.Error(args...)
|
log.Error(args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Debug(args ...interface{}) {
|
|
||||||
log.Debug(args...)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Warn(args ...interface{}) {
|
func Warn(args ...interface{}) {
|
||||||
log.Warn(args...)
|
log.Warn(args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Structured logging methods
|
||||||
func WithField(key string, value interface{}) *logrus.Entry {
|
func WithField(key string, value interface{}) *logrus.Entry {
|
||||||
return log.WithField(key, value)
|
return log.WithField(key, value)
|
||||||
}
|
}
|
||||||
@@ -56,3 +58,7 @@ func WithField(key string, value interface{}) *logrus.Entry {
|
|||||||
func WithFields(fields logrus.Fields) *logrus.Entry {
|
func WithFields(fields logrus.Fields) *logrus.Entry {
|
||||||
return log.WithFields(fields)
|
return log.WithFields(fields)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WithError(err error) *logrus.Entry {
|
||||||
|
return log.WithError(err)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user