Skip to content
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

feat: add json logger output #1026

Merged
merged 3 commits into from
Mar 14, 2022
Merged

feat: add json logger output #1026

merged 3 commits into from
Mar 14, 2022

Conversation

KnisterPeter
Copy link
Member

This will allow to format log output as json.
This is helpful in cases where act is not executed on a 'local' machine.

This will allow to format log output as json.
This is helpful in cases where act is not executed on a 'local' machine.
@KnisterPeter KnisterPeter self-assigned this Mar 3, 2022
@KnisterPeter KnisterPeter marked this pull request as ready for review March 3, 2022 09:04
@KnisterPeter KnisterPeter requested a review from a team as a code owner March 3, 2022 09:04
@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #1026 (b0f8726) into master (4f8da0a) will increase coverage by 1.07%.
The diff coverage is 80.37%.

@@            Coverage Diff             @@
##           master    #1026      +/-   ##
==========================================
+ Coverage   57.50%   58.58%   +1.07%     
==========================================
  Files          32       34       +2     
  Lines        4594     4648      +54     
==========================================
+ Hits         2642     2723      +81     
+ Misses       1729     1696      -33     
- Partials      223      229       +6     
Impacted Files Coverage Δ
pkg/model/action.go 0.00% <ø> (ø)
pkg/model/planner.go 50.73% <ø> (+0.32%) ⬆️
pkg/runner/logger.go 61.76% <64.70%> (-3.67%) ⬇️
pkg/exprparser/interpreter.go 72.79% <66.66%> (-0.61%) ⬇️
pkg/runner/runner.go 74.52% <75.00%> (-1.95%) ⬇️
pkg/runner/expression.go 89.36% <77.61%> (-1.46%) ⬇️
pkg/runner/job_executor.go 81.57% <81.57%> (ø)
pkg/runner/step_context.go 85.81% <84.00%> (+4.17%) ⬆️
pkg/runner/action.go 84.21% <84.21%> (ø)
pkg/runner/run_context.go 80.03% <96.15%> (+0.38%) ⬆️
... and 8 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

ChristopherHX
ChristopherHX previously approved these changes Mar 5, 2022
Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have, it works :)

pkg/runner/logger.go Outdated Show resolved Hide resolved
Using the runner config to configure logging is cleaner.
Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I wondered why I see a Error: <errmsg> line after a failure, which ignored the logrus logger / json formatter. It seems that cobra cli prints it if we return the error back to the library, here the callback which causes the printed line when error != nil

act/cmd/root.go

Line 158 in 3db3c73

return func(cmd *cobra.Command, args []string) error {

@mergify mergify bot merged commit 14c9801 into nektos:master Mar 14, 2022
@KnisterPeter KnisterPeter deleted the allow-json-logger branch March 28, 2022 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants