Log youtube-dl and ffmpeg commands (fixes #297)
This commit is contained in:
parent
7e575e1bb2
commit
96a75cbf14
6 changed files with 359 additions and 310 deletions
33
classes/LoggerFactory.php
Normal file
33
classes/LoggerFactory.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue