mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-12-20 19:35:54 +01:00
27 lines
531 B
PHP
27 lines
531 B
PHP
<?php
|
|
namespace Vichan\Data\Driver;
|
|
|
|
defined('TINYBOARD') or exit;
|
|
|
|
|
|
trait LogTrait {
|
|
public static function levelToString(int $level): string {
|
|
switch ($level) {
|
|
case LogDriver::EMERG:
|
|
return 'EMERG';
|
|
case LogDriver::ERROR:
|
|
return 'ERROR';
|
|
case LogDriver::WARNING:
|
|
return 'WARNING';
|
|
case LogDriver::NOTICE:
|
|
return 'NOTICE';
|
|
case LogDriver::INFO:
|
|
return 'INFO';
|
|
case LogDriver::DEBUG:
|
|
return 'DEBUG';
|
|
default:
|
|
throw new \InvalidArgumentException('Not a logging level');
|
|
}
|
|
}
|
|
}
|