门面模式 Laravel Log::info () 是如何运行的
我用的是laravel 5.2 对应的是 Writer
namespace Illuminate\Log;
class Writer implements LogContract, PsrLoggerInterface
{
public function info($message, array $context = [])
{
return $this->writeLog(__FUNCTION__, $message, $context);
}
}
请问Log::info() 调用的时候,他是怎么绑定到Write这个类的,我在config/app.php下没有看到相关的配置,只看到有个别名
'aliases' => [
'Log' => Illuminate\Support\Facades\Log::class,
]
namespace Illuminate\Support\Facades;
/**
* @see \Illuminate\Log\Writer
*/
class Log extends Facade
{
/**
* Get the registered name of the component
* @return string
*/
protected static function getFacadeAccessor()
{
return 'log';
}
}
推荐文章: