log

package
v0.0.0-...-0ddd045 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package log provides logging utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context string

Context describes a log context

func NewContext

func NewContext(ctx string) Context

NewContext returns a new context

type Logger

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

Logger wraps a log file and the standard logger

func New

func New(c config.LogOptions) (*Logger, error)

New sets up a new logger which writes to file at 'path' with 'prefix'

func (*Logger) Error

func (l *Logger) Error(err error)

Error logs an error via the underlying standard logger

func (*Logger) Errorc

func (l *Logger) Errorc(ctx Context, err error)

Errorc logs an error with context via the underlying standard logger

func (*Logger) Errorf

func (l *Logger) Errorf(format string, v ...interface{})

Errorf logs an error via the underlying standard logger

func (*Logger) Fatal

func (l *Logger) Fatal(err error)

Fatal logs an error via the underlying standard logger and exists with code 1

func (*Logger) Info

func (l *Logger) Info(msg string)

Info logs a info message via the underlying standard logger

func (*Logger) Infoc

func (l *Logger) Infoc(ctx Context, msg string)

Infoc logs a info message with context via the underlying standard logger

func (*Logger) Infof

func (l *Logger) Infof(format string, v ...interface{})

Infof logs a info message via the underlying standard logger

Jump to

Keyboard shortcuts

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