feat: add log.FilePath() function for logger (#7080)

This commit is contained in:
DmitriyLewen
2024-07-02 15:48:20 +06:00
committed by GitHub
parent db68d106ce
commit 1f5f348958
24 changed files with 38 additions and 33 deletions

View File

@@ -445,7 +445,7 @@ func (m *wasmModule) Required(filePath string, _ os.FileInfo) bool {
func (m *wasmModule) Analyze(ctx context.Context, input analyzer.AnalysisInput) (*analyzer.AnalysisResult, error) {
filePath := "/" + filepath.ToSlash(input.FilePath)
log.Debug("Module analyzing...", log.String("module", m.name), log.String("file_path", filePath))
log.Debug("Module analyzing...", log.String("module", m.name), log.FilePath(filePath))
// Wasm module instances are not Goroutine safe, so we take look here since Analyze might be called concurrently.
// TODO: This is temporary solution and we could improve the Analyze performance by having module instance pool.