Log youtube-dl and ffmpeg commands (fixes #297)

This commit is contained in:
Pierre Rudloff 2020-07-15 22:39:46 +02:00
parent 7e575e1bb2
commit 96a75cbf14
6 changed files with 359 additions and 310 deletions

33
classes/LoggerFactory.php Normal file
View file

@ -0,0 +1,33 @@
<?php
namespace Alltube;
use Consolidation\Log\Logger;
use Consolidation\Log\LogOutputStyler;
use Symfony\Component\Console\Output\ConsoleOutput;
/**
* Class LoggerFactory
* @package Alltube
*/
class LoggerFactory
{
/**
* @return Logger
*/
public static function create()
{
$config = Config::getInstance();
if ($config->debug) {
$verbosity = ConsoleOutput::VERBOSITY_DEBUG;
} else {
$verbosity = ConsoleOutput::VERBOSITY_NORMAL;
}
$logger = new Logger(new ConsoleOutput($verbosity));
$logger->setLogOutputStyler(new LogOutputStyler());
return $logger;
}
}