Simplify log wrapper implementation

This commit is contained in:
Jan Eitzinger
2023-02-09 14:14:58 +01:00
parent 3c6b92e9c2
commit c123a87ece
2 changed files with 70 additions and 190 deletions

View File

@@ -88,8 +88,7 @@ func main() {
}
// Apply config flags for pkg/log
log.SetLogLevel(flagLogLevel)
log.SetLogDateTime(flagLogDateTime)
log.Init(flagLogLevel, flagLogDateTime)
// See https://github.com/google/gops (Runtime overhead is almost zero)
if flagGops {
@@ -297,7 +296,7 @@ func main() {
if flagDev {
r.Handle("/playground", playground.Handler("GraphQL playground", "/query"))
r.PathPrefix("/swagger/").Handler(httpSwagger.Handler(
httpSwagger.URL("http://" + config.Keys.Addr + "/swagger/doc.json"))).Methods(http.MethodGet)
httpSwagger.URL("http://" + config.Keys.Addr + "/swagger/doc.json"))).Methods(http.MethodGet)
}
secured.Handle("/query", graphQLEndpoint)