fix(occ): Move debug log listener setup to a static method, add option for level

Also changed option from --debug to --debug-log to avoid conflicts

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet
2024-07-02 16:02:44 +02:00
parent 2ba0819243
commit 9baf8fea8c
3 changed files with 33 additions and 15 deletions
+1 -6
View File
@@ -75,13 +75,8 @@ try {
$eventLogger->start('console:build_application', 'Build Application instance and load commands');
$application = \OCP\Server::get(Application::class);
/* base.php will have removed eventual debug options from argv in $_SERVER */
$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());