mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
Reduce spew of some daemons
Summary: It used to be more useful for daemons to spew random debugging information, but features like "phd debug" and some fixes to error reporting like D1101 provide better ways to debug, test, develop and diagnose daemons. - Stop writing "." every time MetaMTA sends a message. - Stop spewing the entire IRC protocol from the IRC bot unless in debug mode. - Stop writing GC daemon log entries about collecting daemon logs (DURRR) unless in debug mode. Test Plan: Ran daemons in debug and non-debug modes, got expected level of noisiness. Reviewers: jungejason, nh, btrahan Reviewed By: jungejason CC: aran, jungejason Differential Revision: https://secure.phabricator.com/D1268
This commit is contained in:
parent
2cec36d858
commit
5065db5a2a
3 changed files with 8 additions and 4 deletions
|
@ -27,7 +27,6 @@ class PhabricatorMetaMTADaemon extends PhabricatorDaemon {
|
|||
time());
|
||||
foreach ($mail as $message) {
|
||||
$message->sendNow();
|
||||
echo ".";
|
||||
}
|
||||
$this->sleep(1);
|
||||
} while (true);
|
||||
|
|
|
@ -72,6 +72,9 @@ class PhabricatorGarbageCollectorDaemon extends PhabricatorDaemon {
|
|||
$collected = array_filter($collected);
|
||||
|
||||
foreach ($collected as $thing => $count) {
|
||||
if ($thing == 'Daemon Log' && !$this->getTraceMode()) {
|
||||
continue;
|
||||
}
|
||||
$count = number_format($count);
|
||||
echo "Garbage collected {$count} '{$thing}' objects.\n";
|
||||
}
|
||||
|
|
|
@ -236,9 +236,11 @@ final class PhabricatorIRCBot extends PhabricatorDaemon {
|
|||
}
|
||||
|
||||
private function debugLog($is_read, $message) {
|
||||
echo $is_read ? '<<< ' : '>>> ';
|
||||
echo addcslashes($message, "\0..\37\177..\377");
|
||||
echo "\n";
|
||||
if ($this->getTraceMode()) {
|
||||
echo $is_read ? '<<< ' : '>>> ';
|
||||
echo addcslashes($message, "\0..\37\177..\377");
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
public function getConduit() {
|
||||
|
|
Loading…
Reference in a new issue