Page MenuHomePhabricator

In PhutilLogFileChannel, don't log empty messages
ClosedPublic

Authored by epriestley on Feb 16 2017, 1:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 15 2026, 3:09 PM
Unknown Object (File)
Feb 11 2026, 9:09 AM
Unknown Object (File)
Jan 13 2026, 10:07 AM
Unknown Object (File)
Dec 24 2025, 10:02 AM
Unknown Object (File)
Dec 21 2025, 10:53 PM
Unknown Object (File)
Dec 19 2025, 7:15 PM
Unknown Object (File)
Dec 4 2025, 11:00 PM
Unknown Object (File)
Nov 1 2025, 11:20 PM
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.