Files
kiri-core/Kafka/Logger.php
T

121 lines
2.5 KiB
PHP
Raw Normal View History

2020-10-09 16:34:33 +08:00
<?php
2020-10-29 18:17:25 +08:00
declare(strict_types=1);
2020-10-09 16:34:33 +08:00
namespace Kafka;
2020-12-17 14:09:14 +08:00
use Exception;
2020-10-09 16:34:33 +08:00
use Psr\Log\LoggerInterface;
use Snowflake\Exception\ComponentException;
use Snowflake\Snowflake;
/**
* Class Logger
* @package Kafka
*/
class Logger implements LoggerInterface
{
/**
2020-12-17 14:09:14 +08:00
* @param mixed $message
2020-10-09 16:34:33 +08:00
* @param array $context
*/
2020-12-17 14:09:14 +08:00
public function emergency(mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
// TODO: Implement emergency() method.
var_dump(func_get_args());
}
/**
* @param string $message
* @param array $context
* @throws ComponentException
2020-12-17 14:09:14 +08:00
* @throws Exception
2020-10-09 16:34:33 +08:00
*/
2020-12-17 14:09:14 +08:00
public function alert(mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
$logger = Snowflake::app()->getLogger();
$logger->debug($message);
}
2020-12-17 14:09:14 +08:00
public function critical(mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
// TODO: Implement critical() method.
var_dump(func_get_args());
}
/**
* @param string $message
* @param array $context
* @throws ComponentException
2020-12-17 14:09:14 +08:00
* @throws Exception
2020-10-09 16:34:33 +08:00
*/
2020-12-17 14:09:14 +08:00
public function error(mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
$logger = Snowflake::app()->getLogger();
$logger->error($message);
}
/**
* @param string $message
* @param array $context
* @throws ComponentException
*/
2020-12-17 14:09:14 +08:00
public function warning(mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
$logger = Snowflake::app()->getLogger();
$logger->warning($message);
}
/**
* @param string $message
* @param array $context
* @throws ComponentException
*/
2020-12-17 14:09:14 +08:00
public function notice(mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
$logger = Snowflake::app()->getLogger();
$logger->info($message);
}
/**
* @param string $message
* @param array $context
* @throws ComponentException
*/
2020-12-17 14:09:14 +08:00
public function info(mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
$logger = Snowflake::app()->getLogger();
$logger->info($message);
}
2021-02-28 00:10:14 +08:00
2020-10-09 16:34:33 +08:00
/**
* @param string $message
* @param array $context
* @throws ComponentException
2020-12-17 14:09:14 +08:00
* @throws Exception
2020-10-09 16:34:33 +08:00
*/
2020-12-17 14:09:14 +08:00
public function debug(mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
$logger = Snowflake::app()->getLogger();
$logger->debug($message);
}
/**
* @param $level
* @param $message
* @param array $context
* @throws ComponentException
2020-12-17 14:09:14 +08:00
* @throws Exception
2020-10-09 16:34:33 +08:00
*/
2020-12-17 14:09:14 +08:00
public function log($level, mixed $message, array $context = array())
2020-10-09 16:34:33 +08:00
{
$logger = Snowflake::app()->getLogger();
$logger->debug($message);
}
}