glide icon indicating copy to clipboard operation
glide copied to clipboard

feat: add zap logger

Open hanshal101 opened this issue 1 year ago • 3 comments

CLOSES #274 FIXES #274

Description

In this PR I have added a zap logger for the CLI

Additional Information

  • The log looks something like this if run a simple exe after the main.go build
{"level":"fatal","timestamp":"2024-06-27T16:42:37.861+0530","caller":"glide/main.go:44","msg":"💥Glide has finished with error","error":"required flag(s) \"config\" not set","stacktrace":"main.main\n\tH:/glide/main.go:44\nruntime.main\n\tC:/Users/hansh/go/pkg/mod/golang.org/[email protected]/src/runtime/proc.go:271"}

hanshal101 avatar Jun 27 '24 11:06 hanshal101

Hey @roma-glushko I have created the PR. This is just a basic example of the logger, can you please explain and elaborate what else we need to add here. Probably you can help me with where to add these loogers in the CLI.

hanshal101 avatar Jun 27 '24 11:06 hanshal101

@hanshal101 Hey Hanshal, zap logger is already configured in the system: https://github.com/EinStack/glide/blob/develop/pkg/telemetry/logging.go

The goal of #274 is to simplify its usage further across the system by registering a configured instance globally and using it from there everywhere else.

roma-glushko avatar Jun 30 '24 12:06 roma-glushko

Ohh cool, sorry I mis-understood this

hanshal101 avatar Jul 01 '24 07:07 hanshal101