Add logging across app and centralized error handling

This commit is contained in:
Andrey Chervyakov 2021-03-15 19:03:30 +06:00
parent 3bbeab1199
commit 4c3f095109
10 changed files with 115 additions and 62 deletions

13
logger.go Normal file
View file

@ -0,0 +1,13 @@
package cgnolink
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"os"
"time"
)
func ConfigureLogger() {
zerolog.TimeFieldFormat = time.RFC3339Nano
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
}