mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Go: add some overlay-related logging
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"go/types"
|
||||
"io"
|
||||
"log"
|
||||
"log/slog"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
@@ -387,6 +388,7 @@ func NewExtraction(buildFlags []string, patterns []string, sourceRoot string) *E
|
||||
log.Fatalf("Error resolving absolute path of overlay change %s: %s", changedFilePath, err.Error())
|
||||
}
|
||||
overlayChanges[absPath] = true
|
||||
slog.Info("Overlay changed file", "path", absPath)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -739,6 +741,7 @@ func (extraction *Extraction) extractFile(ast *ast.File, pkg *packages.Package)
|
||||
if extraction.OverlayChanges != nil &&
|
||||
!extraction.OverlayChanges[path] &&
|
||||
strings.HasPrefix(path+string(filepath.Separator), pkg.Dir) {
|
||||
slog.Info("Skipping unchanged file in overlay extraction", "path", path)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
"log"
|
||||
"log/slog"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -15,6 +16,9 @@ func init() {
|
||||
pt, err := LoadProjectLayoutFromEnv()
|
||||
if err == nil {
|
||||
pathTransformer = pt
|
||||
if pathTransformer != nil {
|
||||
slog.Info("Loaded path transformer", "from", pathTransformer.From, "to", pathTransformer.To)
|
||||
}
|
||||
} else {
|
||||
log.Fatalf("Unable to load path transformer: %s.\n", err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user