Мы прекращаем поддержку данного сервиса. Читать подробнее в Confluence

Commit 05fa67b8 authored by Роман Яремко's avatar Роман Яремко
Browse files

update log

parent 25995e91
Showing with 8 additions and 21 deletions
+8 -21
package main
import (
"fmt"
"github.com/gorilla/mux"
"net/http"
"{{ cookiecutter.project_slug }}/controllers"
......@@ -10,7 +9,6 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
prom "gitlab.com/msvechla/mux-prometheus/pkg/middleware"
{%- endif %}
"{{ cookiecutter.project_slug }}/utils"
)
func main(){
......
......@@ -12,20 +12,10 @@ var (
)
func InitLogger(){
InfoLog = &log.Logger{
Out: os.Stdout,
Level: log.InfoLevel,
Formatter: &easy.Formatter{
TimestampFormat: "2006-01-02 15:04:05",
LogFormat: "[%lvl%]:\t\t%time% - %msg%\n",
},
}
ErrorLog = &log.Logger{
Out: os.Stdout,
Level: log.FatalLevel,
Formatter: &easy.Formatter{
TimestampFormat: "2006-01-02 15:04:05",
LogFormat: "[%lvl%]:\t%time% - %msg%\n",
},
}
}
\ No newline at end of file
log.SetFormatter(&easy.Formatter{
TimestampFormat: "2006-01-02 15:04:05",
LogFormat: "[%lvl%]: %time% - %msg%\n",
})
log.SetOutput(os.Stdout)
log.SetLevel(log.InfoLevel)
}
......@@ -4,7 +4,6 @@ import (
"os"
"github.com/getsentry/sentry-go"
sentryhttp "github.com/getsentry/sentry-go/http"
"{{ cookiecutter.project_slug }}/utils"
)
func InitSentry() *sentryhttp.Handler{
......@@ -12,7 +11,7 @@ func InitSentry() *sentryhttp.Handler{
Dsn: os.Getenv("SENTRY_GO"),
Environment: os.Getenv("SENTRY_ENV"),
}); err != nil {
utils.ErrorLog.Fatal("Sentry initialization failed: " + err.Error())
ErrorLog.Fatal("Sentry initialization failed: " + err.Error())
}
// Create an instance of sentryhttp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment