diff --git a/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php b/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php index 08a9559279..d2d606f65f 100644 --- a/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php +++ b/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php @@ -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; } diff --git a/src/Core/Logger/Factory/DelegatingLoggerFactory.php b/src/Core/Logger/Factory/DelegatingLoggerFactory.php index 2091b51bd9..f0001132dd 100644 --- a/src/Core/Logger/Factory/DelegatingLoggerFactory.php +++ b/src/Core/Logger/Factory/DelegatingLoggerFactory.php @@ -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 { diff --git a/src/Core/Logger/Factory/Logger.php b/src/Core/Logger/Factory/Logger.php index fbee580544..78451e713d 100644 --- a/src/Core/Logger/Factory/Logger.php +++ b/src/Core/Logger/Factory/Logger.php @@ -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; } diff --git a/src/Core/Logger/Factory/StreamLogger.php b/src/Core/Logger/Factory/StreamLogger.php index b4fbe73dcc..b2c6de7f3e 100644 --- a/src/Core/Logger/Factory/StreamLogger.php +++ b/src/Core/Logger/Factory/StreamLogger.php @@ -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'); diff --git a/src/Core/Logger/Factory/SyslogLogger.php b/src/Core/Logger/Factory/SyslogLogger.php index f95dcb42ff..d9f98f05fd 100644 --- a/src/Core/Logger/Factory/SyslogLogger.php +++ b/src/Core/Logger/Factory/SyslogLogger.php @@ -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')); diff --git a/src/Core/Logger/Util/FileSystemUtil.php b/src/Core/Logger/Util/FileSystemUtil.php index f4052b8c59..1c1bbc2726 100644 --- a/src/Core/Logger/Util/FileSystemUtil.php +++ b/src/Core/Logger/Util/FileSystemUtil.php @@ -11,6 +11,8 @@ use Friendica\Core\Logger\Exception\LoggerUnusableException; /** * interface for Util class for filesystem manipulation for Logger classes + * + * @internal */ interface FileSystemUtil {