hcaptcha-challenger icon indicating copy to clipboard operation
hcaptcha-challenger copied to clipboard

feat(log): logger level

Open bigboy-baby opened this issue 1 year ago • 3 comments

I wanted to make a suggestion to add a feature where we can toggle errors. Specifically in the core.classify function I get really annoyed because my program's console is flooded with "Types of challenges not yet scheduled" errors and it clutters my code. Of course the easiest solution would be to host the solver on a web server, but I still believe it should be a real function. An idea to toggling the logs would be:

challenger = solver.new_challenger(logs=False)

I have not found a way to toggle errors, but it is possible I missed something.

bigboy-baby avatar Apr 03 '23 23:04 bigboy-baby

Ive used

loguru.logger.remove()

But i agree that this would be a nice option

Vinyzu avatar Aug 27 '23 18:08 Vinyzu

@Vinyzu @bigboy-baby https://loguru.readthedocs.io/en/stable/overview.html#suitable-for-scripts-and-libraries

It looks like you can disable loguru logging like this:

logger.disable("my_library")
logger.disable("__main__")
logger.enable("__main__")

Debugging a headless browser is very difficult, so there must be necessary log output in the behavior chain. I will make related features as soon as possible, but if you are interested, you can PR (because there are obviously other higher priority features to be done)

QIN2DIM avatar Aug 30 '23 10:08 QIN2DIM

In addition, Playwright can save browser recording information and XHR packet, which is very helpful for studying Captcha

QIN2DIM avatar Aug 30 '23 10:08 QIN2DIM