Report an Issue

Entries#

Log entries within the Google Cloud Logging API.

class gcloud.logging.entries.ProtobufEntry(payload, logger, insert_id=None, timestamp=None, labels=None, severity=None, http_request=None)[source]#

Bases: gcloud.logging.entries._BaseEntry

Entry created with protoPayload.

See: https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/LogEntry

parse_message(message)[source]#

Parse payload into a protobuf message.

Mutates the passed-in message in place.

Parameters:message (Protobuf message) – the message to be logged
class gcloud.logging.entries.StructEntry(payload, logger, insert_id=None, timestamp=None, labels=None, severity=None, http_request=None)[source]#

Bases: gcloud.logging.entries._BaseEntry

Entry created with jsonPayload.

See: https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/LogEntry

class gcloud.logging.entries.TextEntry(payload, logger, insert_id=None, timestamp=None, labels=None, severity=None, http_request=None)[source]#

Bases: gcloud.logging.entries._BaseEntry

Entry created with textPayload.

See: https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/LogEntry

gcloud.logging.entries.logger_name_from_path(path)[source]#

Validate a logger URI path and get the logger name.

Parameters:path (str) – URI path for a logger API request.
Return type:str
Returns:Logger name parsed from path.
Raises:ValueError if the path is ill-formed or if the project from the path does not agree with the project passed in.