From dcb3184e4e85280d85ebe942f2a1bc3997935f88 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 19 Jun 2023 15:50:48 -0600 Subject: [PATCH] Change logging --- graph.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graph.go b/graph.go index 1b432ba..590baef 100644 --- a/graph.go +++ b/graph.go @@ -23,7 +23,7 @@ type DefaultLogger struct { Components []string } -var log DefaultLogger = DefaultLogger{Loggers: map[string]zerolog.Logger{}, Components: []string{"update", "graph", "event", "resource", "manager", "gql", "gqlws", "gqlws_new", "gqlws_hb", "listeners"}} +var log DefaultLogger = DefaultLogger{Loggers: map[string]zerolog.Logger{}, Components: []string{"gql", "gqlws"}} func (logger * DefaultLogger) Init(components []string) error { logger.init_lock.Lock() @@ -59,7 +59,7 @@ func (logger * DefaultLogger) Init(components []string) error { } func (logger * DefaultLogger) Logm(component string, fields map[string]interface{}, format string, items ... interface{}) { - logger.Init([]string{"gql", "gqlws"}) + logger.Init(logger.Components) l, exists := logger.Loggers[component] if exists == true { log := l.Log() @@ -71,7 +71,7 @@ func (logger * DefaultLogger) Logm(component string, fields map[string]interface } func (logger * DefaultLogger) Logf(component string, format string, items ... interface{}) { - logger.Init([]string{"gql", "gqlws"}) + logger.Init(logger.Components) l, exists := logger.Loggers[component] if exists == true { l.Log().Msg(fmt.Sprintf(format, items...))