File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,16 @@ private function logAutoload(string $relationship)
9191 $ this ->getLogDriver ();
9292
9393 $ file = $ stack ['file ' ];
94- $ lineNo = $ stack ['line ' ];
95-
96- $ blade = $ this ->getBlade ($ file );
97-
98- $ this ->logDriver ->info ("[LARAVEL-JIT-LOADER] Relationship " . static ::class.":: {$ relationship } was JIT-loaded. "
99- ." Called in {$ file } on line {$ lineNo }" . ($ blade ? " view: {$ blade }) " : "" ));
94+
95+ $ this ->logDriver ->info (
96+ '[LARAVEL-JIT-LOADER] Relationship ' .static ::class.':: ' .$ relationship .' was JIT-loaded. ' ,
97+ [
98+ 'relationship ' => static ::class.':: ' .$ relationship ,
99+ 'file ' => $ file ,
100+ 'line ' => $ stack ['line ' ],
101+ 'view ' => $ this ->getBlade ($ file ),
102+ ]
103+ );
100104 }
101105
102106 /**
Original file line number Diff line number Diff line change @@ -51,13 +51,19 @@ public function testGetRelationshipFromMethodUnderThresholdDoesAutoLoad()
5151
5252 public function testGetRelationshipFromMethodUnderThresholdDoesAutoLoadWithLogging ()
5353 {
54- $ message = "[LARAVEL-JIT-LOADER] Relationship " . TraitModel::class . "::myRelationship was JIT-loaded. Called in " . __FILE__ . " on line " . (__LINE__ + 12 );
54+ $ message = "[LARAVEL-JIT-LOADER] Relationship " . TraitModel::class . "::myRelationship was JIT-loaded. " ;
55+ $ context = [
56+ 'relationship ' => TraitModel::class.'::myRelationship ' ,
57+ 'file ' => __FILE__ ,
58+ 'line ' => __LINE__ + 14 ,
59+ 'view ' => false ,
60+ ];
5561
5662 $ driver = $ this ->getMockBuilder (LoggerInterface::class)->getMock ();
5763 $ driver
5864 ->expects ($ this ->atLeastOnce ())
5965 ->method ('info ' )
60- ->with ($ message )
66+ ->with ($ message, $ context )
6167 ->willReturn (true );
6268
6369 $ models = TraitModel::all ();
You can’t perform that action at this time.
0 commit comments