anz-bank / pkg

Common ANZ Go packages
https://pkg.go.dev/github.com/anz-bank/pkg
Apache License 2.0
1 stars 9 forks source link

Ability to log with level="ERROR" #74

Open anz-opata opened 3 years ago

anz-opata commented 3 years ago

The Logger interface allows messages to be logged at three levels (debug, info, error), but the level can only be conveyed to Formatter.Format via the LogEntry struct.

Currently the LogEntry struct communicates this information between Logger and Formatter via a boolean field Verbose, which obviously only allows 2 levels to be differentiated.

Is there an intention to extend this API to allow all three levels to be communicated between Logger and Formatter?

anz-opata commented 3 years ago

I can see from #15 that there was a deliberate decision to log this with level=INFO, but I wonder whether this is unnecessarily restrictive and somewhat misleading.