From d17a82f47a4f0643dc79ddf1d862d4779a1d3704 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 19 Nov 2019 19:19:55 +0100 Subject: [PATCH] Prettify logs --- server.go | 6 +++--- util.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server.go b/server.go index a94c55a..b43809e 100644 --- a/server.go +++ b/server.go @@ -46,7 +46,7 @@ func New(configPath string) (*Server, error) { } // 4. log configuration services - log.Printf("=== Aicra configuration ===\n") + log.Printf("🔧 Reading configuration '%s'\n", configPath) logService(*i.services, "") return i, nil @@ -68,9 +68,9 @@ func (s *Server) Handle(handler *api.Handler) { func (s Server) HTTP() httpServer { // 1. log available handlers - log.Printf("=== Mapped handlers ===\n") + log.Printf("🔗 Mapping handlers\n") for i := 0; i < len(s.handlers); i++ { - log.Printf("* [rest] %s\t'%s'\n", s.handlers[i].GetMethod(), s.handlers[i].GetPath()) + log.Printf(" ->\t%s\t'%s'\n", s.handlers[i].GetMethod(), s.handlers[i].GetPath()) } // 2. cast to http server diff --git a/util.go b/util.go index 2672f76..0a2bf12 100644 --- a/util.go +++ b/util.go @@ -90,9 +90,9 @@ func logService(s config.Service, path string) { for _, method := range handledMethods { if m := s.Method(method); m != nil { if path == "" { - log.Printf("* [rest] %s\t'/'\n", method) + log.Printf(" ->\t%s\t'/'\n", method) } else { - log.Printf("* [rest] %s\t'%s'\n", method, path) + log.Printf(" ->\t%s\t'%s'\n", method, path) } } }