1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

Logging improvements, handler extraction.

- rest: improve error logging.
- web: extract handlers/middleware into their own file.
- web: log all requests, not just ones hitting our handlers.
- test: improve integration test logging format.
This commit is contained in:
James Hillyerd
2018-11-03 19:19:44 -07:00
parent 7a5459ce08
commit 523c04a522
4 changed files with 60 additions and 30 deletions

View File

@@ -23,6 +23,8 @@ import (
"github.com/jhillyerd/inbucket/pkg/storage"
"github.com/jhillyerd/inbucket/pkg/storage/mem"
"github.com/jhillyerd/inbucket/pkg/webui"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
const (
@@ -151,6 +153,7 @@ func formatMessage(m *client.Message) []byte {
func startServer() (func(), error) {
// TODO Refactor inbucket/main.go so we don't need to repeat all this here.
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, NoColor: true})
storage.Constructors["memory"] = mem.New
os.Clearenv()
conf, err := config.Process()