Skip to content

fix: show actual source file location in logs instead of logger internals#132

Merged
andrzej-janczak merged 1 commit intomainfrom
fix/file-logger-location
May 27, 2025
Merged

fix: show actual source file location in logs instead of logger internals#132
andrzej-janczak merged 1 commit intomainfrom
fix/file-logger-location

Conversation

@andrzej-janczak
Copy link
Copy Markdown
Contributor

@andrzej-janczak andrzej-janczak commented May 27, 2025

Previously, log messages showed internal logger locations (e.g. logrus/entry.go:304) instead of the actual source file where the logging occurred.

Before:

2025-05-27T11:49:41+02:00 [INFO] (utils/logger/logger.go:106) Starting Codacy CLI version=development
2025-05-27T11:49:41+02:00 [INFO] (utils/logger/logger.go:106) Executing CLI command full_command=[/Users/czak/Library/Caches/go-build/9c/9caf9ed9717356d0eed8d1ab8ee099d839c3e5306340732eb8232ae2792d62e7-d/cli-v2 init] args=[] command=init
2025-05-27T15:32:48+02:00 [INFO] (utils/logger/logger.go:106) Starting Codacy CLI version=development
2025-05-27T15:32:48+02:00 [INFO] (utils/logger/logger.go:106) Executing CLI command args=[] command=init full_command=[/Users/czak/Library/Caches/go-build/9c/9caf9ed9717356d0eed8d1ab8ee099d839c3e5306340732eb8232ae2792d62e7-d/cli-v2 init --api-token *** --provider gh --organization codacy --repository codacy-cli-v2]
2025-05-27T15:33:14+02:00 [INFO] (utils/logger/logger.go:106) Starting Codacy CLI version=development

Now:

2025-05-27T15:39:18+02:00 [INFO] (cli-v2.go:27) Starting Codacy CLI version=development
2025-05-27T15:39:18+02:00 [INFO] (cmd/root.go:34) Executing CLI command full_command=[/Users/czak/Library/Caches/go-build/73/7337531041144930bf1e5626cddadb65bf307243119abcf072ab9b0289e87c35-d/cli-v2 install] args=[] command=install
2025-05-27T15:39:18+02:00 [INFO] (cmd/install.go:73) All components are already installed
2025-05-27T15:39:30+02:00 [INFO] (cli-v2.go:27) Starting Codacy CLI version=development
2025-05-27T15:39:30+02:00 [INFO] (cmd/root.go:34) Executing CLI command command=analyze full_command=[/Users/czak/Library/Caches/go-build/73/7337531041144930bf1e5626cddadb65bf307243119abcf072ab9b0289e87c35-d/cli-v2 analyze --tool trivy --format sarif] args=[]

…nals

Previously, log messages showed internal logger locations (e.g. logrus/entry.go:304)
instead of the actual source file where the logging occurred.
@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.02% 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8d267ba) 4531 1430 31.56%
Head commit (b3e41ed) 4534 (+3) 1430 (+0) 31.54% (-0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#132) 21 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@andrzej-janczak andrzej-janczak merged commit 868a0a7 into main May 27, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants