mirror of
https://github.com/go-gitea/gitea
synced 2025-07-24 19:28:38 +00:00
Refactor Logger (#13294)
Refactor Logger to make a logger interface and make it possible to wrap loggers for specific purposes. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
@@ -40,7 +40,7 @@ type ElasticSearchIndexer struct {
|
||||
}
|
||||
|
||||
type elasticLogger struct {
|
||||
*log.Logger
|
||||
log.Logger
|
||||
}
|
||||
|
||||
func (l elasticLogger) Printf(format string, args ...interface{}) {
|
||||
|
@@ -27,11 +27,11 @@ type ElasticSearchIndexer struct {
|
||||
}
|
||||
|
||||
type elasticLogger struct {
|
||||
*log.Logger
|
||||
log.LevelLogger
|
||||
}
|
||||
|
||||
func (l elasticLogger) Printf(format string, args ...interface{}) {
|
||||
_ = l.Logger.Log(2, l.Logger.GetLevel(), format, args...)
|
||||
_ = l.Log(2, l.GetLevel(), format, args...)
|
||||
}
|
||||
|
||||
// NewElasticSearchIndexer creates a new elasticsearch indexer
|
||||
|
Reference in New Issue
Block a user