‪TYPO3CMS  11.5
DebugModule.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
25 
30 {
34  public function ‪getIdentifier(): string
35  {
36  return 'debug';
37  }
38 
42  public function ‪getIconIdentifier(): string
43  {
44  return 'actions-debug';
45  }
46 
50  public function ‪getLabel(): string
51  {
52  return $this->‪getLanguageService()->‪sL(
53  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_debug.xlf:module.label'
54  );
55  }
56 
57  public function ‪getShortInfo(): string
58  {
59  $errorsAndWarnings = array_filter(‪InMemoryLogWriter::$log, static function (‪LogRecord $entry) {
60  return ‪LogLevel::normalizeLevel($entry->‪getLevel()) <= 4;
61  });
62  return sprintf($this->‪getLanguageService()->sL(
63  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_debug.xlf:module.shortinfo'
64  ), count($errorsAndWarnings));
65  }
66 }
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule
Definition: AbstractModule.php:31
‪TYPO3\CMS\Core\Localization\LanguageService\sL
‪string sL($input)
Definition: LanguageService.php:161
‪TYPO3\CMS\Core\Log\LogRecord\getLevel
‪string getLevel()
Definition: LogRecord.php:165
‪TYPO3\CMS\Adminpanel\ModuleApi\ShortInfoProviderInterface
Definition: ShortInfoProviderInterface.php:30
‪TYPO3\CMS\Core\Log\LogRecord
Definition: LogRecord.php:22
‪TYPO3\CMS\Adminpanel\Modules
Definition: CacheModule.php:18
‪TYPO3\CMS\Adminpanel\Modules\DebugModule\getLabel
‪getLabel()
Definition: DebugModule.php:50
‪TYPO3\CMS\Adminpanel\Log\InMemoryLogWriter
Definition: InMemoryLogWriter.php:34
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractModule.php:120
‪TYPO3\CMS\Adminpanel\Modules\DebugModule
Definition: DebugModule.php:30
‪TYPO3\CMS\Adminpanel\Modules\DebugModule\getIdentifier
‪getIdentifier()
Definition: DebugModule.php:34
‪TYPO3\CMS\Adminpanel\Modules\DebugModule\getShortInfo
‪getShortInfo()
Definition: DebugModule.php:57
‪TYPO3\CMS\Core\Log\LogLevel\normalizeLevel
‪static int normalizeLevel($level)
Definition: LogLevel.php:94
‪TYPO3\CMS\Adminpanel\Modules\DebugModule\getIconIdentifier
‪getIconIdentifier()
Definition: DebugModule.php:42
‪TYPO3\CMS\Adminpanel\Log\InMemoryLogWriter\$log
‪static LogRecord[] $log
Definition: InMemoryLogWriter.php:37
‪TYPO3\CMS\Core\Log\LogLevel
Definition: LogLevel.php:24