log

package
v0.0.0-...-5ad4fe9 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: BSD-3-Clause Imports: 9 Imported by: 1

Documentation

Overview

Package log provides a simple levelled logger outputing to stdout and a file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

Log provides a simple levelled logger outputing to stdout and a file.

func (*Log) Flush

func (log *Log) Flush()

Flush all buffers associated with the standard logger, if any.

func (*Log) Printf

func (log *Log) Printf(format string, v ...interface{})

Printf calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Log) Println

func (log *Log) Println(v ...interface{})

Info calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Info.

func (*Log) Verbosef

func (log *Log) Verbosef(format string, v ...interface{})

Verbosef calls output to print to the standard logger, only if program is launched with the verbose flag.

func (*Log) Verboseln

func (log *Log) Verboseln(v ...interface{})

Verbose calls output to print to the standard logger, only if program is launched with the verbose flag.

func (*Log) Warnf

func (log *Log) Warnf(format string, v ...interface{})

Warnf calls Output to print a warning to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Log) Warnln

func (log *Log) Warnln(v ...interface{})

Warnln calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Infoln.

type Logger

type Logger interface {
	Flush()
	Printf(string, ...interface{})
	Println(...interface{})
	Verbosef(string, ...interface{})
	Verboseln(...interface{})
	Warnf(string, ...interface{})
	Warnln(...interface{})
}

Logger is the levelled logger interface implemented by Log.

func New

func New(stdOut, verbose bool, filePath string, flags int) Logger

New sets up and returns a new instance of Logger.

Jump to

Keyboard shortcuts

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