1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-12-20 19:35:54 +01:00
vichan/inc/Data/Driver/LogTrait.php

27 lines
531 B
PHP
Raw Normal View History

2024-10-04 12:54:49 +02:00
<?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');
}
}
}