Skip to content

Commit 7635baa

Browse files
committed
feat(qase): log configuration details in JSON format during initialization
- Added logging of the Qase configuration as a formatted JSON string during the initialization process. - Implemented error handling for JSON marshaling to ensure proper logging in case of failures. This update enhances visibility into the configuration loaded by the Qase SDK, aiding in debugging and monitoring.
1 parent 7ca42d9 commit 7635baa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/qase-go/qase/qase.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package qase
22

33
import (
44
"context"
5+
"encoding/json"
56
"fmt"
7+
"log"
68
"runtime"
79
"sync"
810
"testing"
@@ -26,6 +28,14 @@ func init() {
2628
cfg = config.LoadUnsafe()
2729
}
2830

31+
// Log configuration as JSON
32+
cfgJSON, err := json.MarshalIndent(cfg, "", " ")
33+
if err != nil {
34+
log.Printf("Failed to marshal config to JSON: %v", err)
35+
} else {
36+
log.Printf("Qase configuration loaded:\n%s", string(cfgJSON))
37+
}
38+
2939
r, err := reporters.NewCoreReporter(cfg)
3040
if err != nil {
3141
return

0 commit comments

Comments
 (0)