log

package
v0.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(isDebug bool)

InitLogger initialize zap logger

Types

type ILogger

type ILogger interface {
	// Debug uses fmt.Sprint to construct and log a message.
	Debug(args ...any)
	// Info uses fmt.Sprint to construct and log a message.
	Info(args ...any)
	// Warn uses fmt.Sprint to construct and log a message.
	Warn(args ...any)
	// Error uses fmt.Sprint to construct and log a message.
	Error(args ...any)
	// DPanic uses fmt.Sprint to construct and log a message. In development, the
	// log then panics. (See DPanicLevel for details.)
	DPanic(args ...any)
	// Panic uses fmt.Sprint to construct and log a message, then panics.
	Panic(args ...any)
	// Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
	Fatal(args ...any)
	// Debugf uses fmt.Sprintf to log a templated message.
	Debugf(template string, args ...any)
	// Infof uses fmt.Sprintf to log a templated message.
	Infof(template string, args ...any)
	// Warnf uses fmt.Sprintf to log a templated message.
	Warnf(template string, args ...any)
	// Errorf uses fmt.Sprintf to log a templated message.
	Errorf(template string, args ...any)
	// DPanicf uses fmt.Sprintf to log a templated message. In development, the
	// log then panics. (See DPanicLevel for details.)
	DPanicf(template string, args ...any)
	// Panicf uses fmt.Sprintf to log a templated message, then panics.
	Panicf(template string, args ...any)
	// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
	Fatalf(template string, args ...any)
	// Debugw logs a message with some additional context. The variadic key-value
	// pairs are treated as they are in With.
	//
	// When debug-level logging is disabled, this is much faster than
	//  s.With(keysAndValues).Debug(msg)
	Debugw(msg string, keysAndValues ...any)
	// Infow logs a message with some additional context. The variadic key-value
	// pairs are treated as they are in With.
	Infow(msg string, keysAndValues ...any)
	// Warnw logs a message with some additional context. The variadic key-value
	// pairs are treated as they are in With.
	Warnw(msg string, keysAndValues ...any)
	// Errorw logs a message with some additional context. The variadic key-value
	// pairs are treated as they are in With.
	Errorw(msg string, keysAndValues ...any)
	// DPanicw logs a message with some additional context. In development, the
	// log then panics. (See DPanicLevel for details.) The variadic key-value
	// pairs are treated as they are in With.
	DPanicw(msg string, keysAndValues ...any)
	// Panicw logs a message with some additional context, then panics. The
	// variadic key-value pairs are treated as they are in With.
	Panicw(msg string, keysAndValues ...any)
	// Fatalw logs a message with some additional context, then calls os.Exit. The
	// variadic key-value pairs are treated as they are in With.
	Fatalw(msg string, keysAndValues ...any)
}

func L

func L() ILogger

L get log instance

Jump to

Keyboard shortcuts

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