From 9e6ba5a20f2e363d628e878cd38494a2b9b5e8d5 Mon Sep 17 00:00:00 2001 From: Andy Lo-A-Foe Date: Thu, 9 Feb 2023 09:47:01 +0100 Subject: [PATCH] Improve debug logger --- go.mod | 2 +- go.sum | 4 ++-- hsdp/plugin.go | 13 ++++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 4eeea83..dc70853 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/fluent/fluent-bit-go v0.0.0-20220311094233-780004bf5562 github.com/google/uuid v1.3.0 github.com/influxdata/go-syslog/v2 v2.0.1 - github.com/philips-software/go-hsdp-api v0.78.7 + github.com/philips-software/go-hsdp-api v0.79.0 ) require ( diff --git a/go.sum b/go.sum index 7e151aa..c3b4f3d 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ github.com/influxdata/go-syslog/v2 v2.0.1/go.mod h1:hjvie1UTaD5E1fTnDmxaCw8RRDrT github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= -github.com/philips-software/go-hsdp-api v0.78.7 h1:NyGvZ0TSrTfVEYwA6ZdDpWghoBjGuHR5uhcZqYucVRE= -github.com/philips-software/go-hsdp-api v0.78.7/go.mod h1:J9j11CrQR7OXcvsSo+/kE20mkKpAuqB1dxVnXQETsf4= +github.com/philips-software/go-hsdp-api v0.79.0 h1:aiQ2o5xdSvBtZeSnalodQvgADQKHY/MgFdiKq7um+OE= +github.com/philips-software/go-hsdp-api v0.79.0/go.mod h1:J9j11CrQR7OXcvsSo+/kE20mkKpAuqB1dxVnXQETsf4= github.com/philips-software/go-hsdp-signer v1.4.0 h1:yg7UILhmI4xJhr/tQiAiQwJL0EZFvLuMqpH2GZ9ygY4= github.com/philips-software/go-hsdp-signer v1.4.0/go.mod h1:/QehZ/+Aks2t1TFpjhF/7ZSB8PJIIJHzLc03rOqwLw0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/hsdp/plugin.go b/hsdp/plugin.go index c850315..6910f70 100644 --- a/hsdp/plugin.go +++ b/hsdp/plugin.go @@ -143,17 +143,16 @@ func FLBPluginInit(ctx unsafe.Pointer) int { validCreds = true } if serviceID != "" && servicePrivateKey != "" { - debugLog := "" - if enableDebug { - debugLog = "/dev/stderr" - } - iamClient, err := iam.NewClient(nil, &iam.Config{ + cfg := &iam.Config{ Region: region, Environment: environment, IDMURL: idmURL, IAMURL: iamURL, - DebugLog: debugLog, - }) + } + if enableDebug { + cfg.DebugLog = os.Stderr + } + iamClient, err := iam.NewClient(nil, cfg) if err != nil { fmt.Printf("[out-hsdp] invalid service credentials: %v\n", err) plugin.Exit(1)