File tree 4 files changed +29
-2
lines changed
4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 8
8
}
9
9
],
10
10
"require" : {
11
- "google/cloud-logging" : " ^1.10"
11
+ "google/cloud-logging" : " ^1.10" ,
12
+ "psr/log" : " ^1.0|^2.0"
12
13
},
13
14
"require-dev" : {
14
15
"phpstan/phpstan" : " ^1.8" ,
25
26
"psr-4" : {
26
27
"Tests\\ " : " tests/"
27
28
}
29
+ },
30
+ "conflict" : {
31
+ "psr/log" : " >=3"
28
32
}
29
33
}
Original file line number Diff line number Diff line change 10
10
stopOnFailure =" false" >
11
11
<testsuites >
12
12
<testsuite name =" Testsuite" >
13
+ <file >./tests/LogTest.php</file >
13
14
</testsuite >
14
15
</testsuites >
15
16
<php >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Tests ;
6
+
7
+ class LogTest extends TestCase
8
+ {
9
+ /** @test */
10
+ public function it_can_log (): void
11
+ {
12
+ logger ()->emergency ('hey ' );
13
+ }
14
+ }
Original file line number Diff line number Diff line change 2
2
3
3
namespace Tests ;
4
4
5
+ use Stackkit \LaravelGoogleCloudLogging \ViaGoogleCloudLogger ;
6
+
5
7
class TestCase extends \Orchestra \Testbench \TestCase
6
8
{
7
9
protected function getPackageProviders ($ app )
@@ -11,6 +13,12 @@ protected function getPackageProviders($app)
11
13
12
14
protected function getEnvironmentSetUp ($ app )
13
15
{
14
- //
16
+ $ app ['config ' ]->set ('logging.channels.googlecloud ' , [
17
+ 'driver ' => 'custom ' ,
18
+ 'via ' => ViaGoogleCloudLogger::class,
19
+ 'project_id ' => env ('GOOGLE_CLOUD_PROJECT_ID ' ),
20
+ ]);
21
+
22
+ $ app ['config ' ]->set ('logging.default ' , 'googlecloud ' );
15
23
}
16
24
}
You can’t perform that action at this time.
0 commit comments