Page MenuHomePhabricator

In PhutilLogFileChannel, don't log empty messages
ClosedPublic

Authored by epriestley on Feb 16 2017, 1:50 PM.
Tags
None
Referenced Files
F19304361: D17368.id41764.diff
Wed, Dec 24, 10:02 AM
F19242334: D17368.id41764.diff
Sun, Dec 21, 10:53 PM
F19228158: D17368.id41764.diff
Fri, Dec 19, 7:15 PM
F19100273: D17368.diff
Dec 4 2025, 11:00 PM
F18858898: D17368.diff
Nov 1 2025, 11:20 PM
F18837878: D17368.diff
Oct 27 2025, 8:14 AM
F18765948: D17368.id41764.diff
Oct 7 2025, 1:59 PM
F18742106: D17368.id.diff
Oct 2 2025, 5:27 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.