anz-bank / pkg

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

basic set config API and json formatter #7

Closed nofun97 closed 4 years ago

nofun97 commented 4 years ago

Fixes #5 and part of #6

Changes added:

  1. Basic API for adding configuration to logger
  2. Basic JSON format which looks like the following:
    {
    "timestamp": "<time in RFC3339Nano>",
    "message": "<message>",
    "level": "<level>",
    "fields": {
    "fields1": "key1",
    "fields2": "key2",
    ...
    }
    }

One thing to note, I have decided to move the loggers to the same package as the main API. It seems unnecessary and it also allows me to implement a pretty easy to use logger configuration.