8000 update fix for projects with no logs · feczo/python-docs-samples@bda970c · GitHub
[go: up one dir, main page]

Skip to content

Commit bda970c

Browse files
committed
update fix for projects with no logs
1 parent c4010d5 commit bda970c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cloud_logging/api/list_logs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ def list_logs(project_id, logging_service):
3737

3838
while request:
3939
response = request.execute()
40-
if len(response)==0:
41-
print "No logs found in project {0}".format(project_id)
42-
sys.exit(1)
40+
if not response:
41+
print("No logs found in {0} project").format(project_id)
42+
return False
4343
for log in response['logs']:
4444
print(log['name'])
4545

0 commit comments

Comments
 (0)
0