andrewvy/chrome-remote-interface

Refactor logger

Closed this issue · 4 comments

Because of https://bugs.chromium.org/p/chromium/issues/detail?id=773572&can=1&q=stderr&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

Chrome currently logs everything to stderr. Which means that the current logger is very noisy. I'd like to propose a parser that will determine if Logger.info/2, Logger.warn/2, Logger.debug/2, or Logger.error/2 should be used.

There does seem to be some useful information in the log:

"[1029/202012.957526:WARNING:dns_config_service_posix.cc(336)] Failed to read DnsConfig.\n"

in that example we can see WARNING which leads me to believe we can delegate this message to Logger.warn/2

"[1029/184906.750058:INFO:CONSOLE(25315)]

This could be sent to Logger.info/2 or up for debate. It appears INFO:CONSOLE is anything used for console.log in the browser. Not sure if this should be in the server log.

Actually, I think should probably belong in https://github.com/andrewvy/chrome-launcher as that handles the logging of the launched chrome instance. :)

Closed in favor of the correct repo 😄