logger

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT   = "Default"
	DEBUG     = "Debug"
	INFO      = "Info"
	NOTICE    = "Notice"
	WARNING   = "Warning"
	ERROR     = "Error"
	CRITICAL  = "Critical"
	ALERT     = "Alert"
	EMERGENCY = "Emergency"
)

Variables

View Source
var (
	Factory = Must(New(context.Background(), projectID))
)

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Severity string    `json:"severity"`
	Message  string    `json:"message"`
	Time     time.Time `json:"time"`
	Trace    string    `json:"logging.googleapis.com/trace"`
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func (*Logger) Debug

func (l *Logger) Debug(format string, a ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, a ...interface{})

func (*Logger) ErrorReport

func (l *Logger) ErrorReport(format string, a ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, a ...interface{})

func (*Logger) Log

func (l *Logger) Log(severity, format string, a ...interface{})

func (*Logger) LogReport

func (l *Logger) LogReport(severity, format string, a ...interface{})

func (*Logger) Span

func (l *Logger) Span(span trace.Span) *SpanLogEntry

func (*Logger) SpanOf

func (l *Logger) SpanOf(spanID string) *SpanLogEntry

type LoggerFactory

type LoggerFactory struct {
	// contains filtered or unexported fields
}

func Must

func Must(f *LoggerFactory, err error) *LoggerFactory

func New

func New(ctx context.Context, projectID string) (*LoggerFactory, error)

func (*LoggerFactory) Close

func (f *LoggerFactory) Close()

func (*LoggerFactory) New

func (f *LoggerFactory) New(traceID string, req *http.Request) *Logger

type SpanLogEntry

type SpanLogEntry struct {
	Severity string    `json:"severity"`
	Message  string    `json:"message"`
	Time     time.Time `json:"time"`
	Trace    string    `json:"logging.googleapis.com/trace"`
	SpanID   string    `json:"logging.googleapis.com/spanId"`
	// contains filtered or unexported fields
}

func (*SpanLogEntry) Debug

func (e *SpanLogEntry) Debug(format string, a ...interface{})

func (*SpanLogEntry) Error

func (e *SpanLogEntry) Error(format string, a ...interface{})

func (*SpanLogEntry) ErrorReport

func (e *SpanLogEntry) ErrorReport(format string, a ...interface{})

func (*SpanLogEntry) Log

func (e *SpanLogEntry) Log(severity, format string, a ...interface{})

func (*SpanLogEntry) LogReport

func (e *SpanLogEntry) LogReport(severity, format string, a ...interface{})

Jump to

Keyboard shortcuts

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