Add standard and structured logging methods to enhance logging capabilities
This commit is contained in:
parent
459422bc60
commit
1be345b07f
1 changed files with 10 additions and 4 deletions
|
|
@ -33,6 +33,11 @@ func Init(level string, filePath string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Standard logging methods
|
||||
func Debug(args ...interface{}) {
|
||||
log.Debug(args...)
|
||||
}
|
||||
|
||||
func Info(args ...interface{}) {
|
||||
log.Info(args...)
|
||||
}
|
||||
|
|
@ -41,14 +46,11 @@ func Error(args ...interface{}) {
|
|||
log.Error(args...)
|
||||
}
|
||||
|
||||
func Debug(args ...interface{}) {
|
||||
log.Debug(args...)
|
||||
}
|
||||
|
||||
func Warn(args ...interface{}) {
|
||||
log.Warn(args...)
|
||||
}
|
||||
|
||||
// Structured logging methods
|
||||
func WithField(key string, value interface{}) *logrus.Entry {
|
||||
return log.WithField(key, value)
|
||||
}
|
||||
|
|
@ -56,3 +58,7 @@ func WithField(key string, value interface{}) *logrus.Entry {
|
|||
func WithFields(fields logrus.Fields) *logrus.Entry {
|
||||
return log.WithFields(fields)
|
||||
}
|
||||
|
||||
func WithError(err error) *logrus.Entry {
|
||||
return log.WithError(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue