Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use equals for logger list_entries
logName in the v2 API expects the fully
qualified name. The colon operator is “contains”
so it works since the fully qualified name 
contains itself, but it is not indexed and can be
 extremely slow.
  • Loading branch information
Bill Prin committed Jun 9, 2016
commit ea2a9076117093263aa9985fa11ce1bacb772205
2 changes: 1 addition & 1 deletion gcloud/logging/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def list_entries(self, projects=None, filter_=None, order_by=None,
more entries can be retrieved with another call (pass that
value as ``page_token``).
"""
log_filter = 'logName:%s' % (self.name,)
log_filter = 'logName=%s' % (self.full_name,)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

if filter_ is not None:
filter_ = '%s AND %s' % (filter_, log_filter)
else:
Expand Down
6 changes: 4 additions & 2 deletions gcloud/logging/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ def test_delete_w_alternate_client(self):
def test_list_entries_defaults(self):
LISTED = {
'projects': None,
'filter_': 'logName:%s' % (self.LOGGER_NAME),
'filter_': 'logName=projects/%s/logs/%s' %
(self.PROJECT, self.LOGGER_NAME),
'order_by': None,
'page_size': None,
'page_token': None,
Expand All @@ -371,7 +372,8 @@ def test_list_entries_explicit(self):
PAGE_SIZE = 42
LISTED = {
'projects': ['PROJECT1', 'PROJECT2'],
'filter_': '%s AND logName:%s' % (FILTER, self.LOGGER_NAME),
'filter_': '%s AND logName=projects/%s/logs/%s' %
(FILTER, self.PROJECT, self.LOGGER_NAME),
'order_by': DESCENDING,
'page_size': PAGE_SIZE,
'page_token': TOKEN,
Expand Down