File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,17 @@ function helloLogging(ServerRequestInterface $request): string
3737 // This doesn't log anything
3838 error_log ('error_log does not log in Cloud Functions! ' );
3939
40+ // This will log an error message and immediately terminate the function execution
41+ // trigger_error('fatal errors are logged!');
42+
4043 // For HTTP functions, this is added to the HTTP response
4144 // For CloudEvent functions, this does nothing
4245 var_dump ('var_dump goes to HTTP response for HTTP functions ' );
46+
47+ // You can also dump variables using var_export() and forward
48+ // the resulting string to Cloud Logging via an fwrite() call.
49+ $ entry = var_export ('var_export output can be captured. ' , true );
50+ fwrite ($ log , $ entry );
4351
4452 // Functions must return a String or PSR-7 Response object
4553 return '' ;
You can’t perform that action at this time.
0 commit comments