gromer

#golang#htmx#ssr

git clone https://git.pyrossh.dev/gromer

gromer is a framework and cli to build multipage web apps in golang using htmx and alpinejs.


aba3133 — Peter John 2022-04-15T18:12:15+05:30
fix cloud logging again

Generated files not shown: go.sum

Files changed (2) hide show
  1. go.mod +0 -1
  2. http.go +6 -9
go.mod CHANGED
@@ -7,7 +7,6 @@ require (
7
7
  github.com/carlmjohnson/versioninfo v0.22.1
8
8
  github.com/go-playground/validator/v10 v10.9.0
9
9
  github.com/gorilla/mux v1.8.0
10
- github.com/hirosassa/zerodriver v0.1.1
11
10
  github.com/imdario/mergo v0.3.12
12
11
  github.com/pkg/errors v0.9.1
13
12
  github.com/rs/zerolog v1.26.1
http.go CHANGED
@@ -19,7 +19,6 @@ import (
19
19
 
20
20
  "github.com/go-playground/validator/v10"
21
21
  "github.com/gorilla/mux"
22
- "github.com/hirosassa/zerodriver"
23
22
  "github.com/pyros2097/gromer/handlebars"
24
23
  "github.com/rs/zerolog"
25
24
  "github.com/rs/zerolog/log"
@@ -33,15 +32,13 @@ var IsCloundRun bool
33
32
  func init() {
34
33
  IsCloundRun = os.Getenv("K_REVISION") != ""
35
34
  info, _ = debug.ReadBuildInfo()
35
+ zerolog.LevelFieldName = "severity"
36
36
  zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
37
- if IsCloundRun {
38
- log.Logger = log.Output(zerodriver.NewProductionLogger())
39
- } else {
40
- log.Logger = log.Output(zerolog.ConsoleWriter{
37
+ log.Logger = log.Output(zerolog.ConsoleWriter{
41
- Out: os.Stdout,
38
+ Out: os.Stdout,
39
+ NoColor: IsCloundRun,
42
- TimeFormat: zerolog.TimeFormatUnix,
40
+ PartsExclude: []string{zerolog.TimestampFieldName},
43
- })
41
+ })
44
- }
45
42
  }
46
43
 
47
44
  var RouteDefs []RouteDefinition