-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add Support for Safaridriver Debug Logs #563
Comments
Although
... The only recent-ish manpage I found on the web is here: https://gist.github.com/foolip/a0d7ac345a67a09a709ef7b28b3924ce Contents pasted just in case gist goes poof:
|
I'll stick with my plan to use the Clear out any existing logs...
Start safaridriver:
From a separate terminal... Force some logging:
Have a look at the generated log filename:
Look at pid for
Zut alors, So what process has a PID of
And I don't see a process connection between the Huh. That all jives with safaridriver being user-cruel. |
Option 1 - assume only 1 safaridriver runningI could make the assumption that the doc recommendations of only having one Pro:
Con:
Option 2 - dummy correlation idCall WebDriver Let's see if that might work:
From another terminal:
And let's take a peek to see if that dummy value is written:
Pro:
Con:
Option 3 - Use lsofSafaridriver is running on port 9999 (See setup in option 2)
And this is the correct pid for the log file. Pro:
Con:
|
I am looking at optionally pretty printing log output as part of this work. My initial idea was to show prefixes like:
Where A few rabbit holes later, I have not found a way to preserve the log line order of stdout and stderr and also distinguish them. So when pretty printing, my next plan is to redirect stderr to stdout and lose the distinction.
I think, for this use case, distinguishing |
Problem/Opportunity
Safaridriver is different from other WebDriver implementations.
It has fewer features, and its docs induce head-scratching, at least for me.
When diagnosing mysterious behavior, it can be very helpful to enable WebDriver logging.
We support this easily for all WebDriver implementations, except for safaridriver, via
:log-stdout
and:log-stderr
(and:driver-log-level
).When I need safaridriver logging, I will hack some temporary code into Etaoin to get it to spit out safaridriver debug logs. After the mystery is solved, the hack is abandoned, and how I achieved it fades from my memory.
Technical Details
Safaridriver debug logging is enabled via its
--diagnose
command line option.There don't seem to be any logging levels to set.
Other WebDrivers send output to stdout/stderr, but safaridriver always writes its logs to
~/Library/Logs/com.apple.WebDriver/safaridriver.{safaridriver pid}.{random chars}.txt
.Proposed Solution
It would be nice to have a way to ask Etaoin to spit out safaridriver logs.
Interpret
:driver-log-level
ofdebug
to turn safaridriver logging on.Stream to log to stdout; this will allow the reuse of the existing
:log-stdout
feature.Alternative Solutions
Don't stream log; spit it to stdout when the safaridriver process is closed.
This would be simpler to implement but less useful.
Additional context
The safaridriver PID is part of its log filename. Determining the safaridriver PID should be straightforward in jdk9+, but we currently still support jdk8+. If I decide to stick with jdk8+ support, whatever technique I come up with only has to work on macOS, the only platform where safaridriver is currently supported.
Action
I'll likely tackle this one. If he remembers, future-me might thank me.
The text was updated successfully, but these errors were encountered: