Skip to content

Commit 04099cb

Browse files
committed
enhance debug logs
1 parent a527598 commit 04099cb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ func filterVariants(module, variant string, variantsMap gradle.Variants) (gradle
112112
func main() {
113113
var config Configs
114114

115+
if debug := os.Getenv("is_debug"); debug == "yes" {
116+
log.SetEnableDebugLog(true)
117+
log.Debugf("Debug mode enabled")
118+
}
119+
115120
if err := stepconf.Parse(&config); err != nil {
116121
failf("Couldn't create step config: %v\n", err)
117122
}

testaddon.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ import (
44
"fmt"
55
"strings"
66
"unicode"
7+
8+
"github.com/bitrise-io/go-utils/log"
79
)
810

911
// getUniqueDir returns the unique subdirectory inside the test addon export diroctory for a given artifact.
1012
func getUniqueDir(path string) (string, error) {
13+
log.Debugf("getUniqueDir(%s)", path)
1114
parts := strings.Split(path, "/")
1215
i := len(parts) - 1
1316
for i > 0 && parts[i] != "test-results" {
@@ -38,6 +41,8 @@ func getUniqueDir(path string) (string, error) {
3841
return "", fmt.Errorf("get module name: out of index error")
3942
}
4043
module := parts[i-2]
44+
ret := module + "-" + variant
4145

42-
return module + "-" + variant, nil
46+
log.Debugf("getUniqueDir(%s): (%s,%s)", path, ret, nil)
47+
return ret, nil
4348
}

0 commit comments

Comments
 (0)