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
37
37
// This doesn't log anything
38
38
error_log ('error_log does not log in Cloud Functions! ' );
39
39
40
+ // This will log an error message and immediately terminate the function execution
41
+ // trigger_error('fatal errors are logged!');
42
+
40
43
// For HTTP functions, this is added to the HTTP response
41
44
// For CloudEvent functions, this does nothing
42
45
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 );
43
51
44
52
// Functions must return a String or PSR-7 Response object
45
53
return '' ;
You can’t perform that action at this time.
0 commit comments