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

Option to disable debug mode #2488

Open
mcascone opened this issue Oct 16, 2024 · 12 comments · May be fixed by #2490
Open

Option to disable debug mode #2488

mcascone opened this issue Oct 16, 2024 · 12 comments · May be fixed by #2490
Labels
kind/feature-request New feature or request

Comments

@mcascone
Copy link

mcascone commented Oct 16, 2024

Act version

act version 0.2.68

Feature description

I may be doing something wrong, but act always prints all debug messages during runs. This is extremely noisy and unhelpful. It should not be the default, and at least it should able to be turned off.
Is there a trick to disabling debug logging?

As a workaround, I sometimes do act | grep -vE .*debug.*, for example, but this is less than ideal

@mcascone mcascone added the kind/feature-request New feature or request label Oct 16, 2024
@ChristopherHX
Copy link
Contributor

Which debug logging?

In my deriviate of act, this moves ::debug:: from loglevel info to debug prints [DEBUG] if and only if you use the -v toggle
ChristopherHX@72d04de

@mcascone
Copy link
Author

mcascone commented Oct 17, 2024

Stuff like this:

 🐳  docker exec cmd=[/usr/local/bin/node /var/run/act/actions/actions-checkout@v4/dist/index.js] user= workdir=
[init]   💬  ::debug::Getting git version
| [command]/usr/bin/git version
| git version 2.20.1
[init]   💬  ::debug::0
[init]   💬  ::debug::git version 2.20.1%0A
[init]   💬  ::debug::Set git useragent to: git/2.20.1 (github-actions-checkout)
[init]   ⚙  ***
| Temporarily overriding HOME='/tmp/318068a4-5594-4bc6-a037-5a8ef11bf502' before making global git config changes
| Adding repository directory to the temporary git global config as a safe directory
| [command]/usr/bin/git config --global --add safe.directory /Users/casconem/github/my-repo/_default
[init]   💬  ::debug::0
[init]   💬  ::debug::
| [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
[init]   💬  ::debug::1
[init]   💬  ::debug::
| [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
[init]   💬  ::debug::0
[init]   💬  ::debug::
| [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
| http.https://github.com/.extraheader
[init]   💬  ::debug::0
[init]   💬  ::debug::http.https://github.com/.extraheader%0A
| [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
[init]   💬  ::debug::0
[init]   💬  ::debug::
| [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
[init]   💬  ::debug::0
[init]   💬  ::debug::
[init]   💬  ::debug::Unsetting HOME override
[init]   ✅  Success - Post Checkout my-repo

Completely unnecessary even in a debug scenario. I can't find a way to turn it off without an ugly grep -v mechanism, which isn't ideal.

@ChristopherHX
Copy link
Contributor

Do you also mean lines like?

🐳 docker exec cmd=[/usr/local/bin/node /var/run/act/actions/actions-checkout@v4/dist/index.js] user= workdir=

The patch I mentioned disables all lines like

💬 ::debug::0 by default

other lines remain visible...

@mcascone
Copy link
Author

yeah, I'd like to not see the docker commands too, but they're less annoying than the ::debug:: lines.

You mentioned your patch, and I see the commit - how do I pull it?

@ChristopherHX
Copy link
Contributor

that's git magic...

git clone https://github.com/nektos/act act-debug-mode
cd act-debug-mode
# Yes commits from forks can be fetched like this without mentioning the fork at all
git fetch origin 72d04de87e9ced45de483b5b4cd7e65208196684
# Hope the patch applies cleanly, it's over one year old and inside my fork, it's for toggeling debug mode
git cherry-pick 72d04de87e9ced45de483b5b4cd7e65208196684
# Now build it, the go (golang) binary can be found easily
go build
# Now you have your own binary
./act

@ChristopherHX ChristopherHX linked a pull request Oct 18, 2024 that will close this issue
@ChristopherHX ChristopherHX linked a pull request Oct 18, 2024 that will close this issue
@ChristopherHX
Copy link
Contributor

yeah, I'd like to not see the docker commands too, but they're less annoying than the

Please open a dedicated feature request issue for other logged messages that you want to be hidden, the ::debug:: part has a pr from an external first time contributor

@stephenwithav
Copy link

@mcascone Try act -q.

@mcascone
Copy link
Author

mcascone commented Oct 19, 2024 via email

@stephenwithav
Copy link

stephenwithav commented Oct 19, 2024

Sample output with act -q:

INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' 
INFO[0000] deleted cache: &{ID:22 Key:setup-go-linux-ubuntu20-go-1.23.2-2de282dc802c46fa7750e50f1d80cbd30691dd146efdb6ac30c31f629e90fbfa Version:80c03ad9bc0f7552c128ae36020fe5294ef09c552e168fbe45ea237491c60cae Size:72309934 Complete:true UsedAt:1729299932 CreatedAt:1729299389}  module=artifactcache
[CI/build] 🚀  Start image=catthehacker/ubuntu:act-latest
[CI/build]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[CI/build]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[CI/build]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[CI/build]   🐳  docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir=
[CI/build]   ☁  git clone 'https://github.com/actions/setup-go' # ref=v5
[CI/build] Non-terminating error while running 'git clone': some refs were not updated
[CI/build] ⭐ Run Main actions/checkout@v3
[CI/build]   🐳  docker cp src=/home/steven/github/bootstrapping-microservices-in-go/chapter-08/example-3/. dst=/home/steven/github/bootstrapping-microservices-in-go/chapter-08/example-3
[CI/build]   ✅  Success - Main actions/checkout@v3
[CI/build] ⭐ Run Main actions/setup-go@v5
[CI/build]   🐳  docker cp src=/home/steven/.cache/act/actions-setup-go@v5/ dst=/var/run/act/actions/actions-setup-go@v5/
[CI/build]   🐳  docker exec cmd=[/opt/acttoolcache/node/18.20.4/x64/bin/node /var/run/act/actions/actions-setup-go@v5/dist/setup/index.js] user= workdir=
[CI/build]   ⚙  ***
[CI/build]   ❓ add-matcher /run/act/actions/actions-setup-go@v5/matchers.json
[CI/build]   ❓  ::group::go env
[CI/build]   ❓  ::endgroup::
[CI/build]   ✅  Success - Main actions/setup-go@v5
[CI/build]   ⚙  ::set-output:: cache-hit=true
[CI/build]   ⚙  ::set-output:: go-version=1.23.2
[CI/build]   ⚙  ::add-path:: /opt/hostedtoolcache/go/1.23.2/x64/bin
[CI/build]   ⚙  ::add-path:: /root/go/bin
[CI/build] ⭐ Run Main Installing Ginkgo CLI and modules
[CI/build]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir=
[CI/build]   ✅  Success - Main Installing Ginkgo CLI and modules
[CI/build] ⭐ Run Main Installing modules
[CI/build]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/3] user= workdir=
[CI/build]   ✅  Success - Main Installing modules
[CI/build] ⭐ Run Main Running Tests
[CI/build]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/4] user= workdir=
[CI/build]   ✅  Success - Main Running Tests
[CI/build] ⭐ Run Post actions/setup-go@v5
[CI/build]   🐳  docker exec cmd=[/opt/acttoolcache/node/18.20.4/x64/bin/node /var/run/act/actions/actions-setup-go@v5/dist/cache-save/index.js] user= workdir=
[CI/build]   ✅  Success - Post actions/setup-go@v5
[CI/build] Cleaning up container for job build
[CI/build] 🏁  Job succeeded

@mcascone
Copy link
Author

Sample output with act -q:

I still get very noisy output with -q:

[init]   💬  ::debug::Getting git version
[init]   💬  ::debug::0
[init]   💬  ::debug::
[init]   💬  ::debug::0
[init]   💬  ::debug::
[init]   💬  ::debug::0
[init]   💬  ::debug::git version 2.20.1%0A
[init]   💬  ::debug::Set git useragent to: git/2.20.1 (github-actions-checkout)
[init]   ⚙  ***
[init]   💬  ::debug::0
[init]   💬  ::debug::
[init]   💬  ::debug::1
[init]   💬  ::debug::
[init]   💬  ::debug::1
[init]   💬  ::debug::
[init]   💬  ::debug::0
[init]   💬  ::debug::
[init]   💬  ::debug::1
[init]   💬  ::debug::
[init]   💬  ::debug::0
[init]   💬  ::debug::
[init]   💬  ::debug::1
[init]   💬  ::debug::
[init]   💬  ::debug::1
[init]   💬  ::debug::
^C[init]   💬  ::debug::0
[init]   💬  ::debug::git version 2.20.1%0A
[init]   💬  ::debug::Set git useragent to: git/2.20.1 (github-actions-checkout)
[init]   ⚙  ***

@GammaGames
Copy link

GammaGames commented Oct 22, 2024

Yeah this is annoying, I don't need this in my console every run

[Test/smoke_test]   ⚙  ***
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   ❓  ::group::Initializing the repository
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::Initialized empty Git repository in ~
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   ❓  ::endgroup::
[Test/smoke_test]   ❓  ::group::Disabling automatic garbage collection
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   ❓  ::endgroup::
[Test/smoke_test]   ❓  ::group::Setting up auth
[Test/smoke_test]   💬  ::debug::1
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   💬  ::debug::1
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   ❓  ::endgroup::
[Test/smoke_test]   ❓  ::group::Fetching the repository
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   ❓  ::endgroup::
[Test/smoke_test]   ❓  ::group::Determining the checkout info
[Test/smoke_test]   ❓  ::endgroup::
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   💬  ::debug::0
[Test/smoke_test]   💬  ::debug::
[Test/smoke_test]   ❓  ::group::Checking out the ref
[Test/smoke_test]   💬  ::debug::0

I added the snippet from the original comment to my justfile:

act job:
    act -j {{job}} | grep -vE .*debug.*

I can run it with just act [job_name]

@stephenwithav
Copy link

Apologies, the -q is using my PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants