-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Merge code variants from different projects, set TYPO3 8 as re…
…quirement, clean up code
- Loading branch information
Showing
8 changed files
with
103 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
<?php | ||
namespace Cobweb\LogEntries\Log; | ||
|
||
/** | ||
* This file is part of the TYPO3 CMS project. | ||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* (c) 2013 Julien Henchoz <[email protected]> | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* All rights reserved | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
* free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The GNU General Public License can be found at | ||
* http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This script is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
***************************************************************/ | ||
|
||
use TYPO3\CMS\Core\Log\LogManager; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
@@ -30,7 +41,7 @@ class Logger | |
* @param string $message | ||
* @return string | ||
*/ | ||
static public function emergency($process, $message) | ||
public static function emergency($process, $message) | ||
{ | ||
/** @var \TYPO3\CMS\Core\Log\Logger $logger */ | ||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); | ||
|
@@ -42,98 +53,98 @@ static public function emergency($process, $message) | |
|
||
/** | ||
* Sends a critical log to logentries | ||
* @param string $process Process related to this log | ||
* @param string $message | ||
* @return string | ||
*/ | ||
static public function critical($process, $message) | ||
public static function critical($process, $message) | ||
{ | ||
/** @var \TYPO3\CMS\Core\Log\Logger $logger */ | ||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); | ||
// Write to Log | ||
$logger->critical($process . ' - ' . $message); | ||
return $message; | ||
} | ||
|
||
/** | ||
* Sends an alert log to logentries | ||
* @param string $process Process related to this log | ||
* @param string $message | ||
* @return string | ||
*/ | ||
static public function alert($process, $message) | ||
public static function alert($process, $message) | ||
{ | ||
/** @var \TYPO3\CMS\Core\Log\Logger $logger */ | ||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); | ||
// Write to Log | ||
$logger->alert($process . ' - ' . $message); | ||
return $message; | ||
} | ||
|
||
/** | ||
* Sends an error log to logentries | ||
* @param string $process Process related to this log | ||
* @param string $message | ||
* @return string | ||
*/ | ||
static public function error($process, $message) | ||
public static function error($process, $message) | ||
{ | ||
/** @var \TYPO3\CMS\Core\Log\Logger $logger */ | ||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); | ||
// Write to Log | ||
$logger->error($process . ' - ' . $message); | ||
return $message; | ||
} | ||
|
||
/** | ||
* Sends a warning log to logentries | ||
* @param string $process Process related to this log | ||
* @param string $message | ||
* @return string | ||
*/ | ||
static public function warning($process, $message) | ||
public static function warning($process, $message) | ||
{ | ||
/** @var \TYPO3\CMS\Core\Log\Logger $logger */ | ||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); | ||
// Write to Log | ||
$logger->warning($process . ' - ' . $message); | ||
return $message; | ||
} | ||
|
||
/** | ||
* Sends a notice log to logentries | ||
* @param string $process Process related to this log | ||
* @param string $message | ||
* @return string | ||
*/ | ||
static public function notice($process, $message) | ||
public static function notice($process, $message) | ||
{ | ||
/** @var \TYPO3\CMS\Core\Log\Logger $logger */ | ||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); | ||
// Write to Log | ||
$logger->notice($process . ' - ' . $message); | ||
return $message; | ||
} | ||
|
||
/** | ||
* Sends an info log to logentries | ||
* @param string $process Process related to this log | ||
* @param string $message | ||
* @return string | ||
*/ | ||
static public function info($process, $message) | ||
public static function info($process, $message) | ||
{ | ||
/** @var \TYPO3\CMS\Core\Log\Logger $logger */ | ||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); | ||
// Write to Log | ||
$logger->info($process . ' - ' . $message); | ||
return $message; | ||
} | ||
|
||
/** | ||
* Sends a debug log to logentries | ||
* @param string $process Process related to this log | ||
* @param string $message | ||
* @return string | ||
*/ | ||
static public function debug($process, $message) | ||
public static function debug($process, $message) | ||
{ | ||
/** @var \TYPO3\CMS\Core\Log\Logger $logger */ | ||
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); | ||
// Write to Log | ||
$logger->debug($process . ' - ' . $message); | ||
return $message; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
<?php | ||
|
||
namespace Cobweb\LogEntries\Log\Writer; | ||
|
||
/** | ||
* This file is part of the TYPO3 CMS project. | ||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* (c) 2013 Julien Henchoz <[email protected]> | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* All rights reserved | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
* free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The GNU General Public License can be found at | ||
* http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This script is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
***************************************************************/ | ||
|
||
use TYPO3\CMS\Core\Log\LogRecord; | ||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
/** | ||
* Sends log messages to Logentries.com | ||
* | ||
*/ | ||
class LogEntries extends \TYPO3\CMS\Core\Log\Writer\AbstractWriter | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,33 +10,31 @@ | |
* "version" and "dependencies" must not be touched! | ||
***************************************************************/ | ||
|
||
$EM_CONF[$_EXTKEY] = array( | ||
'title' => 'LogEntries logger', | ||
'description' => 'Provides a logger that sends data to LogEntries.com', | ||
'category' => 'services', | ||
'author' => 'Julien Henchoz', | ||
'author_email' => '[email protected]', | ||
'author_company' => 'Cobweb Development SARL', | ||
'shy' => '', | ||
'priority' => '', | ||
'module' => '', | ||
'state' => 'stable', | ||
'internal' => '', | ||
'uploadfolder' => '0', | ||
'createDirs' => '', | ||
'modify_tables' => '', | ||
'clearCacheOnLoad' => 0, | ||
'lockType' => '', | ||
'version' => '1.1.0', | ||
'constraints' => array( | ||
'depends' => array( | ||
'typo3' => '7.6.0-7.6.99', | ||
), | ||
'conflicts' => array( | ||
), | ||
'suggests' => array( | ||
), | ||
), | ||
); | ||
|
||
?> | ||
$EM_CONF[$_EXTKEY] = [ | ||
'title' => 'LogEntries logger', | ||
'description' => 'Provides a logger that sends data to LogEntries.com', | ||
'category' => 'services', | ||
'author' => 'Julien Henchoz', | ||
'author_email' => '[email protected]', | ||
'author_company' => 'Idéative', | ||
'shy' => '', | ||
'priority' => '', | ||
'module' => '', | ||
'state' => 'stable', | ||
'internal' => '', | ||
'uploadfolder' => '0', | ||
'createDirs' => '', | ||
'modify_tables' => '', | ||
'clearCacheOnLoad' => 0, | ||
'lockType' => '', | ||
'version' => '1.1.0', | ||
'constraints' => [ | ||
'depends' => [ | ||
'typo3' => '8.7.0-8.7.99', | ||
], | ||
'conflicts' => [ | ||
], | ||
'suggests' => [ | ||
], | ||
], | ||
]; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<?php | ||
if (!defined('TYPO3_MODE')) { | ||
die ('Access denied.'); | ||
} | ||
|
||
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('logentries') . '/Classes/Log/Logger.php'); | ||
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('logentries') . '/Classes/Log/Writer/LogEntries.php'); | ||
|
||
/** | ||
* Define which logWriter to use for our logging class | ||
*/ | ||
$GLOBALS['TYPO3_CONF_VARS']['LOG']['Cobweb']['LogEntries']['Log']['Logger'] = array( | ||
'writerConfiguration' => array( | ||
\TYPO3\CMS\Core\Log\LogLevel::DEBUG => array( | ||
\Cobweb\LogEntries\Log\Writer\LogEntries::class => array() | ||
), | ||
) | ||
); | ||
$GLOBALS['TYPO3_CONF_VARS']['LOG']['Cobweb']['LogEntries']['Log']['Logger'] = [ | ||
'writerConfiguration' => [ | ||
\TYPO3\CMS\Core\Log\LogLevel::DEBUG => [ | ||
\Cobweb\LogEntries\Log\Writer\LogEntries::class => [ | ||
] | ||
], | ||
] | ||
]; |