[PR #1171] [MERGED] Improve logging #1820

Closed
opened 2026-03-01 21:52:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1171
Author: @ZauberNerd
Created: 5/17/2022
Status: Merged
Merged: 6/17/2022
Merged by: @mergify[bot]

Base: masterHead: improve-logging


📝 Commits (9)

  • 665fb9f feat: use logger from context wherever possible
  • 515c847 feat: add step/job id and results to json logs
  • ccfd5e3 test: value to be masked should not be hard-coded in the action
  • 62930a4 fix: replace values following ::add-mask:: in evaluated strings
  • 062279c feat: [DEBUG] identifier for debug logs to distinguish them
  • 603748d feat: replace logger with step logger
  • 3cdc895 feat: add pre/post stage identifier fields to json log output
  • ce8f113 feat: add job/step result status to skipped steps/jobs
  • a08496c Merge branch 'master' into improve-logging

📊 Changes

35 files changed (+363 additions, -292 deletions)

View changed files

📝 pkg/artifacts/server.go (+5 -5)
📝 pkg/common/executor.go (+1 -3)
📝 pkg/common/git/git.go (+17 -15)
📝 pkg/common/git/git_test.go (+2 -2)
📝 pkg/container/docker_auth.go (+6 -4)
📝 pkg/container/docker_build.go (+3 -4)
📝 pkg/container/docker_pull.go (+5 -6)
📝 pkg/container/docker_pull_test.go (+1 -1)
📝 pkg/container/docker_run.go (+4 -5)
📝 pkg/model/github_context.go (+13 -12)
📝 pkg/model/github_context_test.go (+6 -5)
📝 pkg/runner/action.go (+51 -46)
📝 pkg/runner/action_composite.go (+17 -16)
📝 pkg/runner/action_test.go (+1 -1)
📝 pkg/runner/command.go (+3 -2)
📝 pkg/runner/command_test.go (+1 -1)
📝 pkg/runner/expression.go (+37 -32)
📝 pkg/runner/expression_test.go (+9 -8)
📝 pkg/runner/job_executor.go (+44 -19)
📝 pkg/runner/job_executor_test.go (+13 -1)

...and 15 more files

📄 Description

Replace more of the global logger call sites with contextualized job/step loggers and add job/step id and results as fields to the JSON logger output.

This causes most debug logs to be printed with the job logger, which means they are now correctly prefixed with the job they belong to.
Also, having the ids and results in the JSON output helps in cases where the log is read by machines, because we now can attribute each line to a job/step.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/1171 **Author:** [@ZauberNerd](https://github.com/ZauberNerd) **Created:** 5/17/2022 **Status:** ✅ Merged **Merged:** 6/17/2022 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `improve-logging` --- ### 📝 Commits (9) - [`665fb9f`](https://github.com/nektos/act/commit/665fb9f4a3350b07faef64974ba5452490799bf0) feat: use logger from context wherever possible - [`515c847`](https://github.com/nektos/act/commit/515c847be52a660e460e49f19525ec0a7b93e297) feat: add step/job id and results to json logs - [`ccfd5e3`](https://github.com/nektos/act/commit/ccfd5e3870d700b0f3e2606a99815932e229fd69) test: value to be masked should not be hard-coded in the action - [`62930a4`](https://github.com/nektos/act/commit/62930a4c228eca54060a3e04069021393b1d1245) fix: replace values following ::add-mask:: in evaluated strings - [`062279c`](https://github.com/nektos/act/commit/062279c4bc6c5d1df9185b3abae72e2f9d2c3fe2) feat: [DEBUG] identifier for debug logs to distinguish them - [`603748d`](https://github.com/nektos/act/commit/603748d17698d65a8c99329e20f94b8a2068d579) feat: replace logger with step logger - [`3cdc895`](https://github.com/nektos/act/commit/3cdc895f2fd5836c2871a7199fcae4d68ca359b3) feat: add pre/post stage identifier fields to json log output - [`ce8f113`](https://github.com/nektos/act/commit/ce8f1136399e1d7962bca63a11406fecaa4bd53e) feat: add job/step result status to skipped steps/jobs - [`a08496c`](https://github.com/nektos/act/commit/a08496c5e46bb88f92e228c3a768fedfcbb8231c) Merge branch 'master' into improve-logging ### 📊 Changes **35 files changed** (+363 additions, -292 deletions) <details> <summary>View changed files</summary> 📝 `pkg/artifacts/server.go` (+5 -5) 📝 `pkg/common/executor.go` (+1 -3) 📝 `pkg/common/git/git.go` (+17 -15) 📝 `pkg/common/git/git_test.go` (+2 -2) 📝 `pkg/container/docker_auth.go` (+6 -4) 📝 `pkg/container/docker_build.go` (+3 -4) 📝 `pkg/container/docker_pull.go` (+5 -6) 📝 `pkg/container/docker_pull_test.go` (+1 -1) 📝 `pkg/container/docker_run.go` (+4 -5) 📝 `pkg/model/github_context.go` (+13 -12) 📝 `pkg/model/github_context_test.go` (+6 -5) 📝 `pkg/runner/action.go` (+51 -46) 📝 `pkg/runner/action_composite.go` (+17 -16) 📝 `pkg/runner/action_test.go` (+1 -1) 📝 `pkg/runner/command.go` (+3 -2) 📝 `pkg/runner/command_test.go` (+1 -1) 📝 `pkg/runner/expression.go` (+37 -32) 📝 `pkg/runner/expression_test.go` (+9 -8) 📝 `pkg/runner/job_executor.go` (+44 -19) 📝 `pkg/runner/job_executor_test.go` (+13 -1) _...and 15 more files_ </details> ### 📄 Description Replace more of the global logger call sites with contextualized job/step loggers and add job/step id and results as fields to the JSON logger output. This causes most debug logs to be printed with the job logger, which means they are now correctly prefixed with the job they belong to. Also, having the ids and results in the JSON output helps in cases where the log is read by machines, because we now can attribute each line to a job/step. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:52:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1820
No description provided.