Hard-deprecation for now unused factory classes

This commit is contained in:
Art4 2025-04-14 14:51:44 +00:00
parent d410758cdd
commit 60ad014a6e
6 changed files with 18 additions and 2 deletions

View file

@ -12,6 +12,8 @@ use Psr\Log\LogLevel;
/**
* Abstract class for creating logger types, which includes common necessary logic/content
*
* @deprecated 2025.02 Implement `\Friendica\Core\Logger\Factory\LoggerFactory` instead
*/
abstract class AbstractLoggerTypeFactory
{
@ -25,6 +27,8 @@ abstract class AbstractLoggerTypeFactory
*/
public function __construct(IHaveCallIntrospections $introspection, string $channel)
{
@trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, implement `\Friendica\Core\Logger\Factory\LoggerFactory` instead.', E_USER_DEPRECATED);
$this->channel = $channel;
$this->introspection = $introspection;
}

View file

@ -15,6 +15,8 @@ use Psr\Log\NullLogger;
/**
* Delegates the creation of a logger based on config to other factories
*
* @internal
*/
final class DelegatingLoggerFactory implements LoggerFactory
{

View file

@ -18,6 +18,8 @@ use Throwable;
/**
* The logger factory for the core logging instances
*
* @deprecated 2025.02 Implement `\Friendica\Core\Logger\Factory\LoggerFactory` instead
*/
class Logger
{
@ -26,6 +28,8 @@ class Logger
public function __construct(string $channel = LogChannel::DEFAULT)
{
@trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, implement `\Friendica\Core\Logger\Factory\LoggerFactory` instead.', E_USER_DEPRECATED);
$this->channel = $channel;
}

View file

@ -20,7 +20,7 @@ use Psr\Log\NullLogger;
/**
* The logger factory for the StreamLogger instance
*
* @deprecated 2025.02 Use `Friendica\Core\Logger\Factory\StreamLoggerFactory` instead
* @deprecated 2025.02 Implement `\Friendica\Core\Logger\Factory\LoggerFactory` instead
* @see StreamLoggerFactory
* @see StreamLoggerClass
*/
@ -40,6 +40,8 @@ class StreamLogger extends AbstractLoggerTypeFactory
*/
public function create(IManageConfigValues $config, string $logfile = null, string $channel = null): LoggerInterface
{
@trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, implement `\Friendica\Core\Logger\Factory\LoggerFactory` instead.', E_USER_DEPRECATED);
$fileSystem = new FileSystem();
$logfile = $logfile ?? $config->get('system', 'logfile');

View file

@ -16,7 +16,7 @@ use Psr\Log\LoggerInterface;
/**
* The logger factory for the SyslogLogger instance
*
* @deprecated 2025.02 Use `Friendica\Core\Logger\Factory\SyslogLoggerFactory` instead
* @deprecated 2025.02 Implement `\Friendica\Core\Logger\Factory\LoggerFactory` instead
* @see SyslogLoggerFactory
* @see SyslogLoggerClass
*/
@ -33,6 +33,8 @@ class SyslogLogger extends AbstractLoggerTypeFactory
*/
public function create(IManageConfigValues $config): LoggerInterface
{
@trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, implement `\Friendica\Core\Logger\Factory\LoggerFactory` instead.', E_USER_DEPRECATED);
$logOpts = $config->get('system', 'syslog_flags') ?? SyslogLoggerClass::DEFAULT_FLAGS;
$logFacility = $config->get('system', 'syslog_facility') ?? SyslogLoggerClass::DEFAULT_FACILITY;
$loglevel = SyslogLogger::mapLegacyConfigDebugLevel($config->get('system', 'loglevel'));

View file

@ -11,6 +11,8 @@ use Friendica\Core\Logger\Exception\LoggerUnusableException;
/**
* interface for Util class for filesystem manipulation for Logger classes
*
* @internal
*/
interface FileSystemUtil
{