logger

package module
v0.0.0-...-aa111c9 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: MIT Imports: 2 Imported by: 1

README

Logger

A facility that logs to the standard output channel at various levels of detail.Level 0 disables logging. It's assumed that level 1 sets minimal logging and a bigger level number increases the detail.

log = logger.MakeLogger()

creates a logger.

log.SetLogLevel(0)

sets the level.

fmt.Fprintf(log, "listening on %s\n", fmt.Sprint(config.Localhost, ":", config.Localport))

writes to the log channel. This only has any effect if the level is greater than zero.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggerT

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

LoggerT is the log data.

func MakeLogger

func MakeLogger() LoggerT

MakeLog creates and returns a log.

func (LoggerT) Log

func (l LoggerT) Log() LoggerT

Log gets the log

func (LoggerT) LogLevel

func (l LoggerT) LogLevel() uint8

LogLevel returns the logging level.

func (*LoggerT) SetLogLevel

func (l *LoggerT) SetLogLevel(n uint8)

SetLogLevel sets the log level. 0 is er

func (LoggerT) Write

func (l LoggerT) Write(buf []byte) (n int, err error)

Write to a logging stream.

Jump to

Keyboard shortcuts

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