feat: export setup
parent
56fbea1b6b
commit
ebf2951ea3
|
@ -43,10 +43,10 @@ func init() {
|
|||
viper.SetEnvKeyReplacer(replacer)
|
||||
viper.AutomaticEnv()
|
||||
viper.SetConfigType("json")
|
||||
setup()
|
||||
Setup()
|
||||
}
|
||||
|
||||
func setup() {
|
||||
func Setup() {
|
||||
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||
zerolog.DurationFieldInteger = true
|
||||
zerolog.SetGlobalLevel(zerolog.Level(viper.GetInt("log.level")))
|
||||
|
@ -114,7 +114,7 @@ func ConfigRead(cfgFile string) {
|
|||
if err := viper.ReadInConfig(); err != nil {
|
||||
l.Error().Err(err).Msg("ReadInConfig error")
|
||||
}
|
||||
setup()
|
||||
Setup()
|
||||
}
|
||||
|
||||
// ConfigWrite write current config to file
|
||||
|
|
|
@ -98,7 +98,7 @@ func New() *System {
|
|||
}
|
||||
|
||||
func (sys *System) Start() {
|
||||
// setup()
|
||||
// Setup()
|
||||
sys.order()
|
||||
sys.status = sys_init
|
||||
go func() {
|
||||
|
|
Loading…
Reference in New Issue