feat(occ): Add a --debug option to output all log levels to the output
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
+10
-2
@@ -75,13 +75,21 @@ try {
|
||||
$eventLogger->start('console:build_application', 'Build Application instance and load commands');
|
||||
|
||||
$application = \OCP\Server::get(Application::class);
|
||||
$application->loadCommands(new ArgvInput(), new ConsoleOutput());
|
||||
$argv = $_SERVER['argv'];
|
||||
if (($key = array_search('--debug', $argv)) !== false) {
|
||||
// Remove --debug option if it was passed
|
||||
unset($argv[$key]);
|
||||
$argv = array_values($argv);
|
||||
}
|
||||
|
||||
$input = new ArgvInput($argv);
|
||||
$application->loadCommands($input, new ConsoleOutput());
|
||||
|
||||
$eventLogger->end('console:build_application');
|
||||
$eventLogger->start('console:run', 'Run the command');
|
||||
|
||||
$application->setAutoExit(false);
|
||||
$exitCode = $application->run();
|
||||
$exitCode = $application->run($input);
|
||||
|
||||
$eventLogger->end('console:run');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user