Skip to content

Commit 28a9cf1

Browse files
author
Ace Nassri
authored
Functions: clarify logging behavior (#3935)
Short-term workaround for b/156830703
1 parent c7489cb commit 28a9cf1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

functions/helloworld/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,16 @@ def hello_error_1(request):
188188

189189
def hello_error_2(request):
190190
# [START functions_helloworld_error]
191-
# WILL NOT be reported to Stackdriver Error Reporting, but will show up
192-
# in logs
191+
# These errors WILL NOT be reported to Stackdriver
192+
# Error Reporting, but will show up in logs.
193193
import logging
194194
print(RuntimeError('I failed you (print to stdout)'))
195195
logging.warn(RuntimeError('I failed you (logging.warn)'))
196196
logging.error(RuntimeError('I failed you (logging.error)'))
197197
sys.stderr.write('I failed you (sys.stderr.write)\n')
198198

199-
# This WILL be reported to Stackdriver Error Reporting
199+
# This is considered a successful execution and WILL NOT be reported to
200+
# Stackdriver Error Reporting, but the status code (500) WILL be logged.
200201
from flask import abort
201202
return abort(500)
202203
# [END functions_helloworld_error]

0 commit comments

Comments
 (0)