golog

package module
v0.0.0-...-5abb567 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 5 Imported by: 0

README

golog

another Go logger

GitHub Go Reference Go Report Card Go GitHub go.mod Go version (branch)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	io.Writer
	io.Closer
	Sync() error
}

File represents a file required for output

type LevelName

type LevelName string

LevelName represents level name to print in output

type Levels

type Levels []LevelName

Levels represents levels by priority to name first item has highest priority

func (Levels) IndexOf

func (set Levels) IndexOf(name LevelName) int

IndexOf returns index of name in level set or -1 if not exists

type Logger

type Logger interface {
	io.Closer
	Sync()
	With(format string, level int, sync bool, hierarchy ...string) Prepared
}

Logger represents a Logger

func New

func New(output Output, levels Levels) Logger

New make a new Logger

type Output

type Output interface {
	io.Closer
	Sync()
	Append(data string, level string, hierarchy ...string)
}

Output represents a log output

func OutputFile

func OutputFile(f File) Output

OutputFile cast a File to a log output

type Prepared

type Prepared interface {
	Log(data ...interface{})
}

Prepared represents a prepared log child

Jump to

Keyboard shortcuts

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