You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
560 B
PHTML

2 years ago
<?php
declare(strict_types=1);
namespace App\Helper;
use Hyperf\Logger\LoggerFactory;
use Hyperf\Utils\ApplicationContext;
class Log
{
public static function get(string $name = 'app')
{
return ApplicationContext::getContainer()->get(LoggerFactory::class)->get($name);
}
public static function __callStatic($method, $args)
{
$name = 'app';
if (isset($args[2])) {
$name = $args[2];
unset($args[2]);
}
return call_user_func_array([self::get($name), $method], $args);
}
}