From 1254b7b52211d660e022f0c3dcc40aa0bc90e4e4 Mon Sep 17 00:00:00 2001 From: Osmany Montero Date: Fri, 16 Feb 2024 12:06:54 +0200 Subject: [PATCH] merge main/office365 --- office365/utils/utils.go | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/office365/utils/utils.go b/office365/utils/utils.go index 24105959b..510b36c6c 100644 --- a/office365/utils/utils.go +++ b/office365/utils/utils.go @@ -1,12 +1,31 @@ package utils -import "github.com/threatwinds/logger" +import ( + "log" + "os" + "strconv" + + "github.com/threatwinds/logger" +) var Logger *logger.Logger func init() { + lenv := os.Getenv("LOG_LEVEL") + var level int + var err error + + if lenv != "" && lenv != " " { + level, err = strconv.Atoi(lenv) + if err != nil { + log.Fatalln(err) + } + } else { + level = 400 + } + Logger = logger.NewLogger(&logger.Config{ Format: "text", - Level: 200, + Level: level, }) }