Select Git revision
logs_test.go
logs_test.go 990 B
package logs_test
import (
"os"
"testing"
"gitlab.com/uafrica/go-utils/errors"
"gitlab.com/uafrica/go-utils/logs"
)
func TestLogs(t *testing.T) {
//requestID := t.Name()
//event := events.APIGatewayProxyRequest{}
os.Setenv("DEBUGGING", "true")
//logs.InitLogs(&requestID, &event)
// formatter := log.TextFormatter{}
// log.SetFormatter(&formatter)
logs.InfoWithFields(map[string]interface{}{"a": 1, "b": 2}, "MyLogMessage1")
logs.Info("MyLogMessage2=%d,%d,%d", 1, 2, 3)
logs.ErrorWithFields(map[string]interface{}{"a": 4, "b": 5}, errors.Errorf("simple mistake"))
logs.ErrorWithMsg("Error Message", errors.Errorf("another simple mistake"))
logs.Warn("Warning about a=%s,%s,%s", "a", "b", "c")
logs.WarnWithFields(map[string]interface{}{"a": 4, "b": 5}, errors.Errorf("Cant believe it failed"))
logs.SQLDebugInfo("SELECT * from user")
//logs.LogRequestInfo(event)
//api_logs.LogSQSEvent(sqsEvent)
//api_logs.Errorf("Debugging %d!", 456)
//api_logs.Error("Info")
}