From b6d15377dda0b8ac509b4defd6a7313c6c744444 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 20 May 2014 16:45:13 -0700 Subject: [PATCH] Show daemon arguments when launching a daemon with `./bin/phd`. Summary: Ref T4735. When launching daemons (with `./bin/phd start` or `./bin/phd launch`), print the arguments that are specified for the daemon. Test Plan: Ran `./bin/phd launch repo -- --not X`. ``` > sudo ./bin/phd launch repo -- --not X Preparing to launch daemons. NOTE: Logs will appear in '/mnt/logs/phd/daemons.log'. Launching daemon "PhabricatorRepositoryPullLocalDaemon" with arguments ["--not","X"]. ``` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T4735 Differential Revision: https://secure.phabricator.com/D9205 --- .../PhabricatorDaemonManagementWorkflow.php | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php index 54e071b201..f9b13409f8 100644 --- a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php @@ -99,15 +99,32 @@ abstract class PhabricatorDaemonManagementWorkflow $console = PhutilConsole::getConsole(); if ($debug) { - $console->writeOut( - pht( - 'Launching daemon "%s" in debug mode (not daemonized).', - $daemon)."\n"); + if ($argv) { + $console->writeOut( + pht( + "Launching daemon \"%s\" in debug mode (not daemonized) ". + "with arguments %s.\n", + $daemon, + csprintf('%LR', $argv))); + } else { + $console->writeOut( + pht( + "Launching daemon \"%s\" in debug mode (not daemonized).\n", + $daemon)); + } } else { - $console->writeOut( - pht( - 'Launching daemon "%s".', - $daemon)."\n"); + if ($argv) { + $console->writeOut( + pht( + "Launching daemon \"%s\" with arguments %s.\n", + $daemon, + csprintf('%LR', $argv))); + } else { + $console->writeOut( + pht( + "Launching daemon \"%s\".\n", + $daemon)); + } } foreach ($argv as $key => $arg) {