-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bill Prin
committed
May 10, 2017
1 parent
a2a6be2
commit ef54bc1
Showing
2 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,7 +288,8 @@ def log_proto(self, message, client=None, labels=None, insert_id=None, | |
the entry. | ||
:type resource: :class:`~google.cloud.logging.resource.Resource` | ||
:param resource: Monitored resource of the entry | ||
:param resource: Monitored resource of the entry, defaults | ||
to the global resource type. | ||
:type timestamp: :class:`datetime.datetime` | ||
:param timestamp: (optional) timestamp of event being logged. | ||
|
@@ -369,7 +370,12 @@ class Batch(object): | |
:param client: The client to use. | ||
:type resource: :class:`~google.cloud.logging.resource.Resource` | ||
:param resource: (Optional) Monitored resource of the batch | ||
:param resource: (Optional) Monitored resource of the batch, defaults | ||
to None, which requires that every entry should have a | ||
resource specified. Since the methods used to write | ||
entries default the entry's resource to the global | ||
resource type, this parameter is only required and used | ||
if an entry resource is explicitly set to None. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
waprin
Contributor
|
||
""" | ||
def __init__(self, logger, client, resource=None): | ||
self.logger = logger | ||
|
@@ -408,7 +414,11 @@ def log_text(self, text, labels=None, insert_id=None, severity=None, | |
:param timestamp: (optional) timestamp of event being logged. | ||
:type resource: :class:`~google.cloud.logging.resource.Resource` | ||
:param resource: (Optional) Monitored resource of the entry | ||
:param resource: (Optional) Monitored resource of the entry. Defaults | ||
to the global resource type. If set to None, the | ||
resource of the batch is used for this entry. If | ||
both this resource and the Batch resource are None, | ||
the API will return an error. | ||
""" | ||
self.entries.append( | ||
('text', text, labels, insert_id, severity, http_request, | ||
|
@@ -439,7 +449,11 @@ def log_struct(self, info, labels=None, insert_id=None, severity=None, | |
:param timestamp: (optional) timestamp of event being logged. | ||
:type resource: :class:`~google.cloud.logging.resource.Resource` | ||
:param resource: (Optional) Monitored resource of the entry | ||
:param resource: (Optional) Monitored resource of the entry. Defaults | ||
to the global resource type. If set to None, the | ||
resource of the batch is used for this entry. If | ||
both this resource and the Batch resource are None, | ||
the API will return an error. | ||
""" | ||
self.entries.append( | ||
('struct', info, labels, insert_id, severity, http_request, | ||
|
@@ -470,7 +484,11 @@ def log_proto(self, message, labels=None, insert_id=None, severity=None, | |
:param timestamp: (optional) timestamp of event being logged. | ||
:type resource: :class:`~google.cloud.logging.resource.Resource` | ||
:param resource: (Optional) Monitored resource of the entry | ||
:param resource: (Optional) Monitored resource of the entry. Defaults | ||
to the global resource type. If set to None, the | ||
resource of the batch is used for this entry. If | ||
both this resource and the Batch resource are None, | ||
the API will return an error. | ||
""" | ||
self.entries.append( | ||
('proto', message, labels, insert_id, severity, http_request, | ||
|
This statement is partially false. This parameter is always used in the payload if it is non-null.