logging

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package logging provides a Logger to write logs.

Index

Constants

View Source
const (
	LevelDebug = 0
	LevelInfo  = 1
	LevelWarn  = 2
	LevelError = 3
)

Logging levels.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger formats and writes logs to stderr.

func New

func New(level int) *Logger

New creates a Logger with the given logging level.

func (*Logger) Debug

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

Debug writes a formatted debug log.

func (*Logger) Error

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

Error writes a formatted error log.

func (*Logger) Info

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

Info writes a formatted info log.

func (*Logger) Level

func (l *Logger) Level() int

Level returns the logging level.

func (*Logger) Warn

func (l *Logger) Warn(format string, operands ...interface{})

Warn writes a formatted warn log.

Jump to

Keyboard shortcuts

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