1
0
Fork 0
forked from forgejo/forgejo

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:
zeripath 2020-10-31 05:36:46 +00:00 committed by GitHub
parent ffc8ce7bae
commit 47dd1cb7ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 215 additions and 116 deletions

View file

@ -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