diff --git a/src/Command/AnalyzeCommand.php b/src/Command/AnalyzeCommand.php index 6b84fe5..6d7fc74 100644 --- a/src/Command/AnalyzeCommand.php +++ b/src/Command/AnalyzeCommand.php @@ -4,7 +4,7 @@ namespace OrpheusNET\Logchecker\Command; use OrpheusNET\Logchecker\Logchecker; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\{InputArgument,InputOption,InputInterface}; use Symfony\Component\Console\Output\OutputInterface; class AnalyzeCommand extends Command { @@ -13,7 +13,8 @@ class AnalyzeCommand extends Command { ->setName('analyze') ->setDescription('analyze log file') ->setHelp('This command analyzes a log file') - ->addArgument('file', true, 'Log file to analyze'); + ->addOption('output', null, InputOption::VALUE_NONE, 'Print the HTML log text') + ->addArgument('file', InputArgument::REQUIRED, 'Log file to analyze'); } protected function execute(InputInterface $input, OutputInterface $output) { @@ -35,5 +36,11 @@ class AnalyzeCommand extends Command { $output->writeln(' '.$detail); } } + + if ($input->getOption('output')) { + $output->writeln(''); + $output->writeln('Log Text:'); + $output->writeln($log_text); + } } } \ No newline at end of file diff --git a/src/Logchecker.php b/src/Logchecker.php index 5e62ec9..c0c830d 100644 --- a/src/Logchecker.php +++ b/src/Logchecker.php @@ -87,7 +87,7 @@ class Logchecker { } } catch (\Exception $exc) { - $this->account('chardet failed to analyze log encoding', false, false, true, true); + $this->account('chardet failed to analyze log encoding', false, false, false, true); } } } @@ -144,9 +144,15 @@ class Logchecker { if (empty($this->EAC_LANG['en'][$Key])) { continue; } - $Log = preg_replace('/'.preg_quote($Value, '/').'/ui', $this->EAC_LANG['en'][$Key], $this->Log); - if ($Log !== null) { - $this->Log = $Log; + + if (!is_array($Value)) { + $Value = [$Value]; + } + foreach ($Value as $VValue) { + $Log = preg_replace('/'.preg_quote($VValue, '/').'/ui', $this->EAC_LANG['en'][$Key], $this->Log); + if ($Log !== null) { + $this->Log = $Log; + } } } break; diff --git a/src/eac_languages.php b/src/eac_languages.php index cfd75b3..2963fb6 100644 --- a/src/eac_languages.php +++ b/src/eac_languages.php @@ -315,7 +315,10 @@ $EAC_LANG['ru'] = array( 1308 => "Качество", 1328 => "Высокое", 1329 => "Низкое", - 1309 => "Добавление ID3-тега", + 1309 => [ + "Добавление ID3-тега", + "Добавление ID3-тэга", + ], 1310 => "Формат сэмплов", 1320 => "Обработка зазоров", 1321 => "Не обнаружено, добавлено к предыдущему треку",