log

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(format string, args ...interface{})

Error logs a message at the error log level.

func Errorc

func Errorc(ctx context.Context, format string, args ...interface{})

Errorc logs a message at the error log level.

func Errorv

func Errorv(ctx context.Context, args ...D)

Errorv logs a message at the error log level.

func Errorw

func Errorw(ctx context.Context, args ...interface{})

Errorw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.

func Info

func Info(format string, args ...interface{})

Info logs a message at the info log level.

func Infoc

func Infoc(ctx context.Context, format string, args ...interface{})

Infoc logs a message at the info log level.

func Infov

func Infov(ctx context.Context, args ...D)

Infov logs a message at the info log level.

func Infow

func Infow(ctx context.Context, args ...interface{})

Infow logs a message with some additional context. The variadic key-value pairs are treated as they are in With.

func Warn

func Warn(format string, args ...interface{})

Warn logs a message at the warning log level.

func Warnc

func Warnc(ctx context.Context, format string, args ...interface{})

Warnc logs a message at the warning log level.

func Warnv

func Warnv(ctx context.Context, args ...D)

Warnv logs a message at the warning log level.

func Warnw

func Warnw(ctx context.Context, args ...interface{})

Warnw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.

Types

type D

type D = core.Field

D represents a map of entry level data used for structured logging. type D map[string]interface{}

func KV

func KV(key string, value interface{}) D

KV return a log kv for logging field. NOTE: use KV{type name} can avoid object alloc and get better performance. []~( ̄▽ ̄)~*干杯

func KVDuration

func KVDuration(key string, value time.Duration) D

KVDuration construct Field with Duration value.

func KVFloat32

func KVFloat32(key string, value float32) D

KVFloat32 construct Field with float32 value.

func KVFloat64

func KVFloat64(key string, value float64) D

KVFloat64 construct Field with float64 value.

func KVInt

func KVInt(key string, value int) D

KVInt construct Field with int value.

func KVInt64

func KVInt64(key string, value int64) D

KVInt64 construct D with int64 value.

func KVString

func KVString(key string, value string) D

KVString construct Field with string value.

func KVUint

func KVUint(key string, value uint) D

KVUint construct Field with uint value.

func KVUint64

func KVUint64(key string, value uint64) D

KVUint64 construct Field with uint64 value.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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