mirror of
https://github.com/friendica/friendica
synced 2025-04-27 02:30:10 +00:00
Remove unused Friendica\Core\Logger::enableWorker() and disableWorker()
This commit is contained in:
parent
2f811f99de
commit
9d09b10537
1 changed files with 1 additions and 47 deletions
|
@ -18,58 +18,12 @@ use Psr\Log\LoggerInterface;
|
|||
*/
|
||||
class Logger
|
||||
{
|
||||
/**
|
||||
* LoggerInterface The default Logger type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const TYPE_LOGGER = LoggerInterface::class;
|
||||
/**
|
||||
* WorkerLogger A specific worker logger type, which can be enabled
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const TYPE_WORKER = WorkerLogger::class;
|
||||
/**
|
||||
* @var string $type LoggerInterface The current logger type
|
||||
*/
|
||||
private static $type = self::TYPE_LOGGER;
|
||||
|
||||
/**
|
||||
* @return LoggerInterface|WorkerLogger
|
||||
*/
|
||||
private static function getInstance()
|
||||
{
|
||||
if (self::$type === self::TYPE_LOGGER) {
|
||||
return DI::logger();
|
||||
} else {
|
||||
return DI::workerLogger();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable additional logging for worker usage
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @param string $functionName The worker function, which got called
|
||||
*
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function enableWorker(string $functionName)
|
||||
{
|
||||
self::$type = self::TYPE_WORKER;
|
||||
DI::workerLogger()->setFunctionName($functionName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable additional logging for worker usage
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public static function disableWorker()
|
||||
{
|
||||
self::$type = self::TYPE_LOGGER;
|
||||
return DI::logger();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue