Skip to main content

GcpFormatter

This class is a log formatter compatible with GCP Stackdriver logging.

Methods


Format()

@classmethod
def Format(
entry: *logrus.Entry
) - > ([]byte, error)

Formats a log entry into a byte slice suitable for GCP Stackdriver logging. This method is used to transform standard log entries into a format compatible with Google Cloud's logging service.

Parameters

NameTypeDescription
entry*logrus.EntryThe logrus entry to be formatted for GCP Stackdriver.

Returns

TypeDescription
([]byte, error)A byte slice representing the formatted log entry and an error if formatting fails.