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

There should be a way to disable the headless browsers' output #55

Open
vgalin opened this issue Jan 27, 2022 · 2 comments
Open

There should be a way to disable the headless browsers' output #55

vgalin opened this issue Jan 27, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@vgalin
Copy link
Owner

vgalin commented Jan 27, 2022

Following #54. A way to toggle browsers' output on or off could be useful, especially if the information displayed is not related to errors or bugs that can be fixed.

Example of this output using Chromium/Chrome (taken from issue #28):

[0615/164730.282582:ERROR:file_io.cc(91)] ReadExactly: expected 8, observed 0
[0615/164730.283193:ERROR:xattr.cc(63)] setxattr org.chromium.crashpad.database.initialized on file /var/folders/8_/qh0jnghd1xd_99znh3z6tvgc0000gn/T/: Operation not permitted (1)
[0615/164730.329920:WARNING:headless_browser_main_parts.cc(106)] Cannot create Pref Service with no user data dir.
[0615/164730.396624:WARNING:address_sorter_posix.cc(388)] FromSockAddr failed on netmask

In some cases, the browser just spams the stdout/stderr with errors or warnings that cannot be resolved. However, in other cases, when screenshots fail to be taken, these messages could hold valuable hints and allow the users to solve the issue : for this reason, these messages may not be silenced by default.

@MadeInPierre
Copy link

Hi, thanks for this project!

Are there any news for this issue? I need to have a quiet output as I'm creating a CLI tool that uses this project.

Any guidance on how to implement something to solve this issue myself?

Thank you!

@peterwilli
Copy link

Any guidance on how to implement something to solve this issue myself?

It's implemented already under the name disable_logging! (Undocumented, but working). The following works:

hti = Html2Image(disable_logging=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants