Page MenuHomePhabricator

In PhutilLogFileChannel, don't log empty messages
ClosedPublic

Authored by epriestley on Feb 16 2017, 1:50 PM.
Tags
None
Referenced Files
F15494428: D17368.id41764.diff
Sat, Apr 12, 11:49 PM
F15492653: D17368.id41796.diff
Sat, Apr 12, 4:53 PM
F15457861: D17368.id41764.diff
Sun, Mar 30, 7:31 PM
F15456345: D17368.id41796.diff
Sun, Mar 30, 8:55 AM
F15454558: D17368.id.diff
Sat, Mar 29, 7:04 PM
F15452087: D17368.diff
Sat, Mar 29, 1:41 AM
F15442687: D17368.diff
Thu, Mar 27, 12:00 AM
F15430885: D17368.id41764.diff
Mon, Mar 24, 9:27 AM
Subscribers
None

Details

Summary

Ref T2794. The LogFile channel is used to debug another channel by sending all the messages to a logfile.

We perform empty (zero-length) reads over nonblocking channels in various reasonable situations. Currently, these get written to the logfile as empty lines. However, they are probably never useful.

Instead, only write data if it has nonzero length.

Test Plan

After this change, debugging output from the experimental Phage stuff no longer fills up the protocol logfile with tons of empty messages.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 17 2017, 11:57 PM
This revision was automatically updated to reflect the committed changes.