Skip to content

chore: add more logs #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pkg/testcoverage/coverage/cover.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"golang.org/x/tools/cover"

"github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/logger"
"github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/path"
)

Expand Down Expand Up @@ -47,6 +48,7 @@ func GenerateCoverageStats(cfg Config) ([]Stats, error) {
}

if ok := matches(excludeRules, fi.name); ok {
logger.L.Debug().Str("file", fi.name).Msg("file excluded")
continue // this file is excluded
}

Expand Down Expand Up @@ -189,8 +191,7 @@ func listAllFiles(rootDir string) []fileInfo {
return name
}

//nolint:errcheck // error ignored because there is fallback mechanism for finding files
filepath.Walk(rootDir, func(file string, info os.FileInfo, err error) error {
err := filepath.Walk(rootDir, func(file string, info os.FileInfo, err error) error {
if err != nil { // coverage-ignore
return err
}
Expand All @@ -206,6 +207,9 @@ func listAllFiles(rootDir string) []fileInfo {

return nil
})
if err != nil { // coverage-ignore
logger.L.Error().Err(err).Msg("listing go files")
}

return files
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/testcoverage/coverage/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ func findModuleDirective(rootDir string) string {
logger.L.Warn().Msg("`module` directive not found")
}

logger.L.Debug().Str("module", module).Msg("using module directive")

return module
}

Expand Down
Loading