logger

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: MIT Imports: 5 Imported by: 33

README

go-logger

A simple logger for small project

APIs

  • Trace(args ...interface{})

  • Tracef(format string, args ...interface{})

  • Tracew(msg string, args ...interface{})

  • Debug(args ...interface{})

  • Debugf(format string, args ...interface{})

  • Debugw(msg string, args ...interface{})

  • Info(args ...interface{})

  • Infof(format string, args ...interface{})

  • Infow(msg string, args ...interface{})

  • Warn(args ...interface{})

  • Warnf(format string, args ...interface{})

  • Warnw(msg string, args ...interface{})

  • Error(args ...interface{})

  • Errorf(format string, args ...interface{})

  • Errorw(msg string, args ...interface{})

  • Panic(args ...interface{})

  • Panicf(format string, args ...interface{})

  • Panicw(msg string, args ...interface{})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug debug log

func Debugf

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

Debugf debug log with format

func Debugw

func Debugw(msg string, args ...interface{})

Debugw debug log with additional context

func Error

func Error(args ...interface{})

Error error log

func Errorf

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

Errorf error log with format

func Errorw

func Errorw(msg string, args ...interface{})

Errorw error log with additional context

func Info

func Info(args ...interface{})

Info info log

func Infof

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

Infof info log with format

func Infow

func Infow(msg string, args ...interface{})

Infow info log with additional context

func Panic

func Panic(args ...interface{})

Panic panic log

func Panicf

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

Panicf panic log with format

func Panicw

func Panicw(msg string, args ...interface{})

Panicw panic log with additional context

func SetFormat added in v0.3.0

func SetFormat(format LogFormat)

SetFormat set log format

func SetLevel

func SetLevel(level string) error

SetLevel set log level

func Trace added in v0.2.0

func Trace(args ...interface{})

Trace trace log

func Tracef added in v0.2.0

func Tracef(format string, args ...interface{})

Tracef trace log with format

func Tracew added in v0.2.0

func Tracew(msg string, args ...interface{})

Tracew trace log with additional context

func Warn

func Warn(args ...interface{})

Warn warning log

func Warnf

func Warnf(format string, args ...interface{})

Warnf warning log with format

func Warnw

func Warnw(msg string, args ...interface{})

Warnw warn log with additional context

Types

type LogFormat added in v0.3.1

type LogFormat string
var (
	FORMAT_CONSOLE LogFormat = "console"
	FORMAT_JSON    LogFormat = "json"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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