cloudlogging

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package cloudlogging provides Cloud Logging adapter for batch logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLogEntry

func FormatLogEntry(entry *logging.Entry, maxLen int) ports.BatchLogEntry

FormatLogEntry extracts a cleaned, human-readable message from a Cloud Logging entry. Message extraction priority:

  1. String payload (text message)
  2. JSON payload with "message" key
  3. JSON payload (stringified)
  4. Fallback: fmt.Sprintf("%v", payload), truncated

The returned message is truncated to maxLen characters.

Types

type CloudLoggingRepository

type CloudLoggingRepository struct{}

CloudLoggingRepository implements BatchLogsRepository using Google Cloud Logging.

func NewCloudLoggingRepository

func NewCloudLoggingRepository() *CloudLoggingRepository

NewCloudLoggingRepository creates a new Cloud Logging adapter.

func (*CloudLoggingRepository) GetLogs

func (r *CloudLoggingRepository) GetLogs(
	ctx context.Context,
	jobName string,
	filter ports.BatchLogsFilter,
) ([]ports.BatchLogEntry, error)

GetLogs retrieves batch logs from Cloud Logging API. Uses Application Default Credentials (ADC) for authentication. projectID is extracted from the jobName resource.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL