logger

package
v0.0.0-...-bec4141 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logger offers simple logging

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v ...interface{})

Debug uses the default logger and logs with the Debug severity. Arguments are handled in the manner of fmt.Print.

func Debugf

func Debugf(format string, v ...interface{})

Debugf uses the default logger and logs with the Debug severity. Arguments are handled in the manner of fmt.Printf.

func Error

func Error(v ...interface{})

Error uses the default logger and logs with the Error severity. Arguments are handled in the manner of fmt.Print.

func Errorf

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

Errorf uses the default logger and logs with the Error severity. Arguments are handled in the manner of fmt.Printf.

func Fatal

func Fatal(v ...interface{})

Fatal uses the default logger, logs with the Fatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Print.

func Fatalf

func Fatalf(format string, v ...interface{})

Fatalf uses the default logger, logs with the Fatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Printf.

func Info

func Info(v ...interface{})

Info uses the default logger and logs with the Info severity. Arguments are handled in the manner of fmt.Print.

func Infof

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

Infof uses the default logger and logs with the Info severity. Arguments are handled in the manner of fmt.Printf.

func Panic

func Panic(v ...interface{})

Panic uses the default logger and logs with the Error severity, and ends up with panic(). Arguments are handled in the manner of fmt.Print.

func Panicf

func Panicf(format string, v ...interface{})

Panicf uses the default logger and logs with the Error severity, and ends up with panic(). Arguments are handled in the manner of fmt.Printf.

func SetFlags

func SetFlags(flag int)

SetFlags sets the output flags of the default logger.

func SetLevel

func SetLevel(lvl int)

SetLevel sets the verbosity level of the default logger.

func SetOutput

func SetOutput(w io.Writer)

SetOutput changes the output of the default logger.

func Warning

func Warning(v ...interface{})

Warning uses the default logger and logs with the Warning severity. Arguments are handled in the manner of fmt.Print.

func Warningf

func Warningf(format string, v ...interface{})

Warningf uses the default logger and logs with the Warning severity. Arguments are handled in the manner of fmt.Printf.

Types

type Logger

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

A Logger represents an active logging object. Multiple loggers can be used simultaneously even if they are using the same writers.

func Init

func Init(level int) *Logger

Init sets up logging and should be called before log functions, usually in the caller's main(). Default log functions can be called before Init(), but every severity will be logged. The first call to Init populates the default logger and returns the generated logger, subsequent calls to Init will only return the generated logger.

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

Debug logs with the Debug severity. Arguments are handled in the manner of fmt.Print.

func (*Logger) Debugf

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

Debugf logs with the Debug severity. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Error

func (l *Logger) Error(v ...interface{})

Error logs with the Error severity. Arguments are handled in the manner of fmt.Print.

func (*Logger) Errorf

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

Errorf logs with the Error severity. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Fatal

func (l *Logger) Fatal(v ...interface{})

Fatal logs with the Fatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Print.

func (*Logger) Fatalf

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

Fatalf logs with the Fatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Printf.

func (*Logger) Info

func (l *Logger) Info(v ...interface{})

Info logs with the Info severity. Arguments are handled in the manner of fmt.Print.

func (*Logger) Infof

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

Infof logs with the Info severity. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Panic

func (l *Logger) Panic(v ...interface{})

Panic uses the default logger and logs with the Error severity, and ends up with panic(). Arguments are handled in the manner of fmt.Print.

func (*Logger) Panicf

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

Panicf uses the default logger and logs with the Error severity, and ends up with panic(). Arguments are handled in the manner of fmt.Printf.

func (*Logger) SetFlags

func (l *Logger) SetFlags(flag int)

SetFlags sets the output flags of the logger.

func (*Logger) SetLevel

func (l *Logger) SetLevel(lvl int)

SetLevel sets the verbosity level of the logger.

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

SetOutput changes the output of the logger.

func (*Logger) Warning

func (l *Logger) Warning(v ...interface{})

Warning logs with the Warning severity. Arguments are handled in the manner of fmt.Print.

func (*Logger) Warningf

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

Warningf logs with the Warning severity. Arguments are handled in the manner of fmt.Printf.

Jump to

Keyboard shortcuts

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