‪TYPO3CMS  10.4
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 {
31 
35  public function ‪getIdentifier(): string
36  {
37  return 'debug';
38  }
39 
43  public function ‪getIconIdentifier(): string
44  {
45  return 'actions-debug';
46  }
47 
51  public function ‪getLabel(): string
52  {
53  return $this->‪getLanguageService()->‪sL(
54  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_debug.xlf:module.label'
55  );
56  }
57 
58  public function ‪getShortInfo(): string
59  {
60  $errorsAndWarnings = array_filter(‪InMemoryLogWriter::$log, function (‪LogRecord $entry) {
61  return ‪LogLevel::normalizeLevel($entry->‪getLevel()) <= 4;
62  });
63  return sprintf($this->‪getLanguageService()->sL(
64  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_debug.xlf:module.shortinfo'
65  ), count($errorsAndWarnings));
66  }
67 }
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule
Definition: AbstractModule.php:31
‪TYPO3\CMS\Core\Localization\LanguageService\sL
‪string sL($input)
Definition: LanguageService.php:194
‪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:51
‪TYPO3\CMS\Adminpanel\Log\InMemoryLogWriter
Definition: InMemoryLogWriter.php:31
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractModule.php:121
‪TYPO3\CMS\Adminpanel\Modules\DebugModule
Definition: DebugModule.php:30
‪TYPO3\CMS\Adminpanel\Modules\DebugModule\getIdentifier
‪getIdentifier()
Definition: DebugModule.php:35
‪TYPO3\CMS\Adminpanel\Modules\DebugModule\getShortInfo
‪getShortInfo()
Definition: DebugModule.php:58
‪TYPO3\CMS\Core\Log\LogLevel\normalizeLevel
‪static int normalizeLevel($level)
Definition: LogLevel.php:94
‪TYPO3\CMS\Adminpanel\Modules\DebugModule\getIconIdentifier
‪getIconIdentifier()
Definition: DebugModule.php:43
‪TYPO3\CMS\Adminpanel\Log\InMemoryLogWriter\$log
‪static LogRecord[] $log
Definition: InMemoryLogWriter.php:34
‪TYPO3\CMS\Core\Log\LogLevel
Definition: LogLevel.php:24