File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,11 +76,17 @@ public function __construct(private array $config = [])
7676 ], [], [
7777 'json_payload ' => function ($ v ) {
7878 return $ this ->formatStructForApi ($ v );
79+ },
80+ 'severity ' => function ($ v ) {
81+ return array_flip (Logger::getLogLevelMap ())[strtoupper ($ v )];
7982 }
8083 ], [
8184 'google.protobuf.Duration ' => function ($ v ) {
8285 return $ this ->formatDurationForApi ($ v );
8386 },
87+ 'google.protobuf.Timestamp ' => function ($ v ) {
88+ return $ this ->formatTimestampForApi ($ v );
89+ }
8490 ]);
8591 $ this ->optionsValidator = new OptionsValidator ($ this ->serializer );
8692 }
Original file line number Diff line number Diff line change @@ -119,7 +119,9 @@ public function methodProvider()
119119 ],
120120 'httpRequest ' => [
121121 'latency ' => ['seconds ' => 1 , 'nanos ' => 0 ]
122- ]
122+ ],
123+ 'timestamp ' => ['seconds ' => 100 ],
124+ 'severity ' => 100 ,
123125 ];
124126 $ sinkData = [
125127 'name ' => $ value ,
@@ -163,7 +165,9 @@ public function methodProvider()
163165 ],
164166 'httpRequest ' => [
165167 'latency ' => '1.0s '
166- ]
168+ ],
169+ 'timestamp ' => date ('Y-m-d H:i:s ' , 100 ),
170+ 'severity ' => 'DEBUG ' ,
167171 ]
168172 ]
169173 ],
You can’t perform that action at this time.
0 commit comments