golog

package
v0.0.0-...-e92e447 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Provides a set of tools and syntax sugar for printing logs. Warning, this package is designed to work with Datadog. We're not using OTEL conventions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetEnv

func SetEnv(env goenv.Env)

Types

type Logger

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

func Log

func Log() *Logger

func (*Logger) Debug

func (l *Logger) Debug(ctx context.Context, message string, opts ...Options)

Debug Prints using the debug level

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, message string, opts ...Options)

Error Prints using the error level

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, message string, opts ...Options)

Info Prints using the info level

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, message string, opts ...Options)

Warn Prints using the warn level

type Options

type Options func(ctx context.Context, message string, logger *Logger, logType logType)

func WithTags

func WithTags(tags map[string]interface{}) Options

WithTags Add a group of tags into current log. Tags are used to provide more context when writing logs.

Jump to

Keyboard shortcuts

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