mirror of
https://github.com/Unkn0wnCat/calapi.git
synced 2025-06-05 01:31:38 +02:00
Add authentication and metrics
This commit is contained in:
parent
7667ea7b90
commit
6abea91d7c
16 changed files with 894 additions and 31 deletions
21
internal/logger/logger.go
Normal file
21
internal/logger/logger.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package logger
|
||||
|
||||
import (
|
||||
"github.com/spf13/viper"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var (
|
||||
Logger *zap.Logger
|
||||
Sugar *zap.SugaredLogger
|
||||
)
|
||||
|
||||
func StartLogger() {
|
||||
Logger, _ = zap.NewProduction()
|
||||
|
||||
if viper.GetBool("development") {
|
||||
Logger, _ = zap.NewDevelopment()
|
||||
}
|
||||
|
||||
Sugar = Logger.Sugar()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue