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

Feature request: introduce logger and verbose mode #354

Open
wataash opened this issue Nov 8, 2019 · 7 comments
Open

Feature request: introduce logger and verbose mode #354

wataash opened this issue Nov 8, 2019 · 7 comments

Comments

@wataash
Copy link

wataash commented Nov 8, 2019

Hi, thank you for creating this great software!

I think reviewdog is too quiet about logging, making it hard to solve issues.

For instance, in -reporter=github-pr-check, CI_COMMIT must be complete (40 digits) sha1. If it's abbreviated to 7 digits (0123abc), reviewdog exits 0 with no output, but in actual an internal error occurs (described in google/go-github#1136) and the execution is failed. I had to debug reviewdog, and it took a few hours to understand what happened behind the scenes.

So I propose:

  • Introduce a logger for leveled-logigng (error, warning, info, debug) (such as logrus)
  • Add flag to control the log level (e.g. -q:error, default:warning, -v:info, -vv:debug)

Any opinion would be appreciated.

@haya14busa
Copy link
Member

haya14busa commented Dec 1, 2019

I like the idea to add verbose logging option.

@reviewdog/helpers Anyone want to design/implement this feature?

@okonomi
Copy link
Member

okonomi commented Dec 8, 2019

While using reviewdog, Two types of problems occur.

  1. reviewdog's own operation problems

Problems related to CI environment information acquisition and git command execution.

  1. lint tool execution problems

lint tool is not working properly.
In many cases the lint tool fails to run in CI environment.

Information to help solve these problems:

  • Environment variables recognized by reviewdog
  • Command executed by reviewdog (argument of git command)
  • Executed lint tool and its result (stdout, stderr)

If I have this information, I will spend less time solving problems.

@renehernandez
Copy link

renehernandez commented Oct 6, 2020

I can start taking a look at this, if no one else is working on it

@renehernandez
Copy link

renehernandez commented Oct 6, 2020

According to this search, there are several files that are using the built-in log module. Is there a still a desired to switch to use a logging tool like zerolog?

@haya14busa
Copy link
Member

haya14busa commented Oct 20, 2020

The focus should be more on the design like what should we log and how to control, etc... instead of switching to some logger lib.

@iamricard
Copy link

iamricard commented Dec 18, 2020

I'm not fluent in Go, but would like to see this implemented. Are you still looking for help in this?

As for design on what to log and how to control it, it sounds like @okonomi had a good initial proposal on what to log. I think Executed lint tool and its result (stdout, stderr) would be a good start.

For how to control what log, I particularly like eslint's env variable approach. The way it works is you can set DEBUG=eslint:* and any loggers that match that namespace will actually log. Alternatively, we can implement the classic -verbosity={info,warn,error} which would log depending on log level.

I'm happy to take a stab at this if nobody else is going to.

@kpfleming
Copy link

kpfleming commented Jul 30, 2022

As a brand-new user I'm currently struggling with this. I'm trying to use the github-pr-review reporter but not getting the results I expect, and it's quite challenging to find out why. Trial and error is a slow process :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants