gcplog

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 9 Imported by: 1

README

gcplogger

GCP上で、GAEのようなログ出力をするためのライブラリです。

機能

  • GAEのようなリクエストログに紐づくログを出力する
  • ErrorReporting出力

Documentation

Index

Constants

View Source
const (
	DEBUG = iota
	INFO
	WARNING
	ERROR
	CRITICAL
)

Variables

View Source
var Structure = structure{}
View Source
var Text = text{}

Functions

func Criticalf

func Criticalf(ctx context.Context, format string, a ...interface{})

func Debugf

func Debugf(ctx context.Context, format string, a ...interface{})

func Errorf

func Errorf(ctx context.Context, format string, a ...interface{})

func Infof

func Infof(ctx context.Context, format string, a ...interface{})

func Initialize

func Initialize(name, projID string) func(http.Handler) http.Handler

func SetDebug added in v0.0.2

func SetDebug()

func SetLoglevel added in v0.0.2

func SetLoglevel(level int)

func Warningf

func Warningf(ctx context.Context, format string, a ...interface{})

func WithContext

func WithContext(r *http.Request, label string) (context.Context, func())

Types

type LoggerParam

type LoggerParam struct {
	ProjectID string
	SpanID    string
	TraceID   string
}

type Writer

type Writer func(context.Context, string, string, ...interface{})

Jump to

Keyboard shortcuts

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