stackdriver

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package stackdriver send log lines to Google Stackdriver.

It is based on https://godoc.org/cloud.google.com/go/logging

Index

Constants

View Source
const (
	Name = "stackdriver"
)

Variables

This section is empty.

Functions

func New

func New(tree config.Tree) (log.Printer, error)

Types

type Config

type Config struct {
	// A Parent can take any of the following forms:
	//
	// - projects/PROJECT_ID
	// - folders/FOLDER_ID
	// - billingAccounts/ACCOUNT_ID
	// - organizations/ORG_ID
	//
	// for backwards compatibility, a string with no '/' is also allowed and is
	// interpreted as a project ID.
	// ProjectID sets the Google Cloud Platform project ID.
	Parent string `toml:"parent"`
	// Name sets the name of the log to write to.
	//
	// A log ID must be less than 512 characters long and can only
	// include the following characters: upper and lower case alphanumeric
	// characters: [A-Za-z0-9]; and punctuation characters: forward-slash,
	// underscore, hyphen, and period.
	LogID string `toml:"log_id"`
	// FlushPeriod is the frequence on which log lines are flushed to StackDriver
	FlushPeriod int `toml:"flush_period"`
}

Config defines the filer printer config

type Logger

type Logger struct {
	C *logging.Client
	L *logging.Logger
	// contains filtered or unexported fields
}

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) Print

func (l *Logger) Print(ctx *log.Context, s string) error

Jump to

Keyboard shortcuts

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