Bug 31604

Summary: WebSocket server should write errors to a log file
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, levin, yuzo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on: 31861    
Bug Blocks:    
Attachments:
Description Flags
Make pywebsocket log errors to a file
none
Make pywebsocket log errors to a file
none
Make pywebsocket log errors to a file ap: review+, ap: commit-queue-

Description Mark Rowe (bdash) 2009-11-17 16:38:27 PST
It’s currently difficult to work out what is going wrong if the WebSocket server fails to start.  If it wrote its errors to a log file in a similar fashion to what Apache does it would be easier to debug issues that only happen on inaccessible machines (eg, the build bots).
Comment 1 Yuzo Fujishima 2009-11-18 00:23:37 PST
Hi,

I've started addressing this upstream:
http://code.google.com/p/pywebsocket/issues/detail?id=24

After it is done upstream, I'll upload a WebKit patch to upgrade
the pywebsocket copy in WebKitTools to the latest.

Yuzo
Comment 2 Yuzo Fujishima 2009-11-25 23:32:35 PST
Created attachment 43898 [details]
Make pywebsocket log errors to a file
Comment 3 Yuzo Fujishima 2009-11-25 23:34:22 PST
Hi, reviewers,

Can you review this patch?

Yuzo
Comment 4 David Levin 2009-11-26 09:50:07 PST
Since this is perl, I'd prefer if someone else looked at it. (btw, Yuzo, it is a holiday in the US for Thursday and Friday so expect slower responses.)
Comment 5 Eric Seidel (no email) 2009-11-29 13:52:02 PST
Comment on attachment 43898 [details]
Make pywebsocket log errors to a file

Looks OK, but why are we coyping this code from elsewhere?  It should be abstracted into a sub routine.

I see this in the file already:

1380	    my $absTestResultsDirectory = File::Spec->rel2abs(glob $testResultsDirectory);
1381	    my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
1382	
1383	    mkpath $absTestResultsDirectory;
Comment 6 Yuzo Fujishima 2009-11-29 17:48:08 PST
Created attachment 43999 [details]
Make pywebsocket log errors to a file
Comment 7 Yuzo Fujishima 2009-11-29 17:53:08 PST
Thank you for reviewing this.

Refactored by extracting a method.
Can you take another look?

Yuzo
Comment 8 Yuzo Fujishima 2009-11-29 18:07:14 PST
Created attachment 44002 [details]
Make pywebsocket log errors to a file
Comment 9 Adam Barth 2009-11-30 12:48:35 PST
style-queue ran check-webkit-style on attachment 44002 [details] without any errors.
Comment 10 Alexey Proskuryakov 2009-12-01 10:48:29 PST
Comment on attachment 44002 [details]
Make pywebsocket log errors to a file

r=me

I'll try to think of a better name for makeAbsTestResultsDirectory(), and will land manually. The current name is not great for several reasons:
- we don't like abbreviations in names;
- it's not an "absolute directory" that this method makes;
- nothing in the name suggests that there will be a return value.
Comment 11 Alexey Proskuryakov 2009-12-01 10:57:16 PST
Committed <http://trac.webkit.org/changeset/51550>. I also updated ChangeLog to be more useful to readers.