本人在学习自定义日志的时候给我报的错,百思不得其解
Fatal error: Uncaught think\exception\ErrorException: Non-static method think\Log::record() should not be called statically in
或者
Non-static method think\Log::write() should not be called statically
然后想到了
use think\Request;
会报错。
而改成
use think\facade\Request;
就不会报错,
所以我把
use think\Log;
改成
use think\facade\Log;
他就真不会报错。
我是跟着学的版本是5.0,而我自己的版本是5.1,可能是版本差异吧。