mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 20:57:36 +02:00
Restore getLevelName but deprecate it
This commit is contained in:
@@ -28,7 +28,6 @@ Overall / notable changes:
|
||||
e.g. instead of `Logger::WARNING` use `Level::Warning` if you need to pass the enum case
|
||||
to Monolog or one of its handlers, or `Level::Warning->value` if you need the integer
|
||||
value equal to what `Logger::WARNING` was giving you.
|
||||
- `Logger::getLevelName` has been removed in favor of `Monolog\Level->toLevelName()->value`.
|
||||
- `Logger::$levels` has been removed.
|
||||
- `Logger::getLevels` has been removed in favor of `Monolog\Level::VALUES` or `Monolog\Level::cases()`.
|
||||
- `setExceptionHandler` now requires a `Closure` instance and not just any `callable`.
|
||||
|
@@ -365,6 +365,23 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the logging level as a string.
|
||||
*
|
||||
* This still returns a string instead of a LevelName for BC, but new code should not rely on this method.
|
||||
*
|
||||
* @throws \Psr\Log\InvalidArgumentException If level is not defined
|
||||
*
|
||||
* @phpstan-param Level $level
|
||||
* @phpstan-return LevelName
|
||||
*
|
||||
* @deprecated Use Monolog\Level->toLevelName()->value instead
|
||||
*/
|
||||
public static function getLevelName(int|Level $level): string
|
||||
{
|
||||
return self::toMonologLevel($level)->toLevelName()->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts PSR-3 levels to Monolog ones if necessary
|
||||
*
|
||||
|
Reference in New Issue
Block a user