mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
28 lines
487 B
Go
28 lines
487 B
Go
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/spf13/viper"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
// initConfig reads in config file and ENV variables if set.
|
|
func initConfig() {
|
|
viper.EnvKeyReplacer(strings.NewReplacer(".", "_"))
|
|
}
|
|
|
|
// initConfig reads in config file and ENV variables if set.
|
|
func initLogger() {
|
|
var err error
|
|
c := zap.NewProductionConfig()
|
|
c.Level, err = zap.ParseAtomicLevel(logLevel)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
logger, err = c.Build()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|