Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18854450
D10385.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10385.id.diff
View Options
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
@@ -52,9 +52,14 @@
}
$console = PhutilConsole::getConsole();
+
+ $limit = $args->getArg('limit');
+
$logs = id(new PhabricatorDaemonLogEvent())->loadAllWhere(
- 'logID IN (%Ld) ORDER BY id ASC',
- mpull($daemons, 'getID'));
+ 'logID IN (%Ld) ORDER BY id DESC LIMIT %d',
+ mpull($daemons, 'getID'),
+ $limit);
+ $logs = array_reverse($logs);
$lines = array();
foreach ($logs as $log) {
@@ -69,6 +74,11 @@
}
}
+ // Each log message may be several lines. Limit the number of lines we
+ // output so that `--limit 123` means "show 123 lines", which is the most
+ // easily understandable behavior.
+ $lines = array_slice($lines, -$limit);
+
foreach ($lines as $line) {
$id = $line['id'];
$type = $line['type'];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 2 2025, 12:19 AM (14 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8619553
Default Alt Text
D10385.id.diff (1 KB)
Attached To
Mode
D10385: Tweak --limit for bin/phd log
Attached
Detach File
Event Timeline
Log In to Comment