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

Display current status and progress #2

Closed
glarrain opened this Issue Oct 9, 2012 · 5 comments

Comments

Projects
None yet
2 participants
@glarrain

glarrain commented Oct 9, 2012

It would be great to know how is the program doing while executing. For example, if there are too many links, the user can't know if the tool is doing good, is stuck, is close to finish, etc. I think a simple an clean way to report is the way unittest reports the execution: for eah test, a dot is sucess, F is fail, E is error. Then at the end displays an execution summary.

@ghost ghost assigned IlianIliev Oct 10, 2012

@IlianIliev

This comment has been minimized.

Owner

IlianIliev commented Oct 10, 2012

Thanks for the idea. I'll try to make this as soon as possible. Meanwhile have you checked the -v option?

@glarrain

This comment has been minimized.

glarrain commented Oct 10, 2012

Ups, I had not. Well, that does help to check progress, although my proposal still stands, because between -v 1 and -v2 there's quite a difference in output (well, that happens when log level is changed).

Thanks. Let me know if you need help with anything!

@IlianIliev

This comment has been minimized.

Owner

IlianIliev commented Oct 10, 2012

I found a simple way to do this using sys.stdout.write() but I am still a bit hesitant about the mix of logging and stdout. Any idea how can I use the logging module without printing to a new line every time?

@glarrain

This comment has been minimized.

glarrain commented Oct 10, 2012

Well, I think logging should be left out as it is right now, and set up link checking functionality as it were doing assertions in test cases. Checking unittest.case.TestCase.run, I can see several functions from unittest.runner.TextTestResult are called: addSuccess, addError, addFailure, printErrors, printErrorList.

What do you think?

IlianIliev pushed a commit that referenced this issue Oct 16, 2012

@IlianIliev

This comment has been minimized.

Owner

IlianIliev commented Oct 16, 2012

After a deep thought I decided that the dot/F/E output will be inconsistent with the other logging. At the same time I wanted to keep no output if there is no error on verbose 0 because the script is meant to be run with cron. So I just added an info message for each tested URL.

@IlianIliev IlianIliev closed this Oct 16, 2012

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