public function boot() { $this->publishes([__DIR__ . '/../Config/config.php' => config_path('wechat.php')], 'config'); if (config('wechat.debug')) { error_reporting(E_ALL); } Log::setLogger(app('log')); }
/** * Initialize logger. */ private function initializeLogger() { $logger = new Logger('easywechat'); if (!$this['config']['debug'] || defined('PHPUNIT_RUNNING')) { $logger->pushHandler(new NullHandler()); } elseif ($logFile = $this['config']['log.file']) { $logger->pushHandler(new StreamHandler($logFile, $this['config']->get('log.level', Logger::WARNING))); } Log::setLogger($logger); }