Skip to content

Commit

Permalink
Init log module in nknc to prevent panic
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang committed Apr 18, 2021
1 parent 7966f01 commit 2946fbd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/nknc/nknc.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ func init() {
}

func main() {
err := log.Init()
if err != nil {
log.Fatal(err)
}

defer func() {
if r := recover(); r != nil {
log.Fatalf("Panic: %+v", r)
Expand Down

0 comments on commit 2946fbd

Please sign in to comment.