Skip to content

Commit

Permalink
chore: zerolog format
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Jul 14, 2023
1 parent c51f488 commit 78979ec
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package main

import (
"context"

_ "github.com/lib/pq"
"time"

"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
_ "github.com/lib/pq"
"github.com/palantir/go-githubapp/githubapp"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/samber/lo"

Expand All @@ -18,6 +19,9 @@ import (
var version = "development"

func main() {
zerolog.TimeFieldFormat = time.RFC3339Nano
zerolog.MessageFieldName = "msg"

client, err := ent.Open("postgres", config.PgOption)
if err != nil {
log.Fatal().Err(err).Msg("failed opening connection to pg")
Expand Down Expand Up @@ -78,7 +82,10 @@ func main() {
}

// Start server
log.Fatal().Err(e.Start(host + ":" + port)).Msg("failed to start server")
log.Info().Msg("start server")
if err := e.Start(host + ":" + port); err != nil {
log.Fatal().Err(err).Msg("failed to start server")
}
}

func getGithubAppClient() githubapp.ClientCreator {
Expand Down

0 comments on commit 78979ec

Please sign in to comment.