aquasecurity / go-dep-parser

Dependency Parser for Multiple Programming Languages
MIT License
145 stars 109 forks source link

feat: create zap logger on demand #269

Open lebauce opened 1 year ago

lebauce commented 1 year ago

Importing one package causes a logger to be created and Zap logger has a non negligible cost (a few hundred Kilobytes).

This PR simply defers the creation of the logger when it's actually used.

knqyf263 commented 1 year ago

Are you in a hurry? We're planning to replace zap with slog after Go 1.22 is out. This is because we have a policy supporting the two latest Go versions, and slog was added in Go 1.21.

lebauce commented 1 year ago

@knqyf263 Thanks for the notice ! I can definitely wait