logger

package
v0.0.0-...-244c27e Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 5 Imported by: 15

README

package main

import (
	log "github.com/kernelschmelze/pkg/logger"
)

func main() {

	log.Info("hallo")
	log.Debug("hallo")

	log.Warnf("warning: %d failed", 4711)

}


// 0721 15:56:49.278492 INF hallo main.go:9
// 0721 15:56:49.278570 DBG hallo main.go:10
// 0721 15:56:49.278583 WRN warning: 4711 failed main.go:12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(a ...interface{})

func Debugf

func Debugf(f string, a ...interface{})

func Error

func Error(a ...interface{})

func Errorf

func Errorf(f string, a ...interface{})

func Info

func Info(a ...interface{})

func Infof

func Infof(f string, a ...interface{})

func Warn

func Warn(a ...interface{})

func Warnf

func Warnf(f string, a ...interface{})

Types

type DefaultLog

type DefaultLog struct{}

DefaultLog provides a default implementation of the Logger interface.

func (*DefaultLog) Debug

func (*DefaultLog) Debug(a ...interface{})

func (*DefaultLog) Debugf

func (*DefaultLog) Debugf(f string, a ...interface{})

func (*DefaultLog) Error

func (*DefaultLog) Error(a ...interface{})

func (*DefaultLog) Errorf

func (*DefaultLog) Errorf(f string, a ...interface{})

func (*DefaultLog) Info

func (*DefaultLog) Info(a ...interface{})

func (*DefaultLog) Infof

func (*DefaultLog) Infof(f string, a ...interface{})

func (*DefaultLog) Warn

func (*DefaultLog) Warn(a ...interface{})

func (*DefaultLog) Warnf

func (*DefaultLog) Warnf(f string, a ...interface{})

type Logger

type Logger struct {
}

func (*Logger) Debug

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

func (*Logger) Debugf

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

func (*Logger) Error

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

func (*Logger) Errorf

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

func (*Logger) Info

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

func (*Logger) Infof

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

func (*Logger) Warn

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

func (*Logger) Warnf

func (l *Logger) Warnf(f string, v ...interface{})

type SimpleLogger

type SimpleLogger interface {

	// Log with level ERROR
	Error(...interface{})

	// Log formatted messages with level ERROR
	Errorf(string, ...interface{})

	// Log with level WARN
	Warn(...interface{})

	// Log formatted messages with level WARN
	Warnf(string, ...interface{})

	// Log with level INFO
	Info(...interface{})

	// Log formatted messages with level INFO
	Infof(string, ...interface{})

	// Log with level DEBUG
	Debug(...interface{})

	// Log formatted messages with level DEBUG
	Debugf(string, ...interface{})
}

Logger instances provide custom logging.

Jump to

Keyboard shortcuts

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