Entries#

Log entries within the Google Stackdriver Logging API.

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

Bases: google.cloud.logging.entries._BaseEntry

Entry created with protoPayload.

See: https://cloud.google.com/logging/docs/reference/v2/rest/v2/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 google.cloud.logging.entries.StructEntry(payload, logger, insert_id=None, timestamp=None, labels=None, severity=None, http_request=None)[source]#

Bases: google.cloud.logging.entries._BaseEntry

Entry created with jsonPayload.

See: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry

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

Bases: google.cloud.logging.entries._BaseEntry

Entry created with textPayload.

See: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry

google.cloud.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.