[MM-32390] Config logic refactor (#17578)
* Replace config generator * Cleanup * Some renaming and docs additions to add clarity * Cleanup logging related methods * Cleanup emitter * Fix TestDefaultsGenerator * Move feature flags synchronization logic out of config package * Remove unnecessary util functions * Simplify load/set logic * Refine semantics and add some test to cover them * Remove unnecessary deep copies * Improve logic further * Fix license header * Review file store tests * Fix test * Fix test * Avoid additional write during initialization * More consistent naming * Update app/feature_flags.go Co-authored-by: Christopher Speller <crspeller@gmail.com> * Update config/store.go Co-authored-by: Christopher Speller <crspeller@gmail.com> * Update config/store.go Co-authored-by: Christopher Speller <crspeller@gmail.com> * Update config/store.go Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> * Move FF synchronizer to its own package * Remove unidiomatic use of sync.Once * Add some comments * Rename function * More comment Co-authored-by: Christopher Speller <crspeller@gmail.com> Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b810a40062
Коммит
3681cd3688
35
app/featureflag/split_logger.go
Обычный файл
35
app/featureflag/split_logger.go
Обычный файл
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
package featureflag
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/shared/mlog"
|
||||
)
|
||||
|
||||
type splitLogger struct {
|
||||
wrappedLog *mlog.Logger
|
||||
}
|
||||
|
||||
func (s *splitLogger) Error(msg ...interface{}) {
|
||||
s.wrappedLog.Error(fmt.Sprint(msg...))
|
||||
}
|
||||
|
||||
func (s *splitLogger) Warning(msg ...interface{}) {
|
||||
s.wrappedLog.Warn(fmt.Sprint(msg...))
|
||||
}
|
||||
|
||||
// Ignoring more verbose messages from split
|
||||
func (s *splitLogger) Info(msg ...interface{}) {
|
||||
//s.wrappedLog.Info(fmt.Sprint(msg...))
|
||||
}
|
||||
|
||||
func (s *splitLogger) Debug(msg ...interface{}) {
|
||||
//s.wrappedLog.Debug(fmt.Sprint(msg...))
|
||||
}
|
||||
|
||||
func (s *splitLogger) Verbose(msg ...interface{}) {
|
||||
//s.wrappedLog.Info(fmt.Sprint(msg...))
|
||||
}
|
||||
Ссылка в новой задаче
Block a user