/** * 构造函数 */ public function __construct($modelName = null) { if (!is_null($modelName)) { $this->setUserModelProvider($modelName); } Log::info('request_cookie', array('request' => $_COOKIE)); }
public function testRecord() { Log::clear(); Log::record('test'); $this->assertEquals([['type' => 'log', 'msg' => 'test']], Log::getLog()); Log::record('hello', 'info'); $this->assertEquals([['type' => 'log', 'msg' => 'test'], ['type' => 'info', 'msg' => 'hello']], Log::getLog()); Log::clear(); Log::info('test'); $this->assertEquals([['type' => 'info', 'msg' => 'test']], Log::getLog()); }