This commit is contained in:
Jaeger 2017-04-20 13:53:03 +08:00
parent cbae16c6a4
commit 1691ddf3ee

View File

@ -105,6 +105,8 @@ class QueryList
* @param $handler * @param $handler
*/ */
public static function setLog($handler) public static function setLog($handler)
{
if(class_exists(Logger::class))
{ {
if(is_string($handler)) if(is_string($handler))
{ {
@ -112,6 +114,11 @@ class QueryList
} }
self::$logger = new Logger('QueryList'); self::$logger = new Logger('QueryList');
self::$logger->pushHandler($handler); self::$logger->pushHandler($handler);
}else{
throw new Exception("You need to install the package [monolog/monolog]");
}
} }
/** /**