log

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 3 Imported by: 0

Documentation

Overview

Package log provides logging utilities for tnet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...any)

Debug logs to DEBUG log. Arguments are handled in the manner of fmt.Print.

func Debugf

func Debugf(format string, args ...any)

Debugf logs to DEBUG log. Arguments are handled in the manner of fmt.Printf.

func Error

func Error(args ...any)

Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.

func Errorf

func Errorf(format string, args ...any)

Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.

func Fatal

func Fatal(args ...any)

Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print.

func Fatalf

func Fatalf(format string, args ...any)

Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.

func Info

func Info(args ...any)

Info logs to INFO log. Arguments are handled in the manner of fmt.Print.

func Infof

func Infof(format string, args ...any)

Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.

func Warn

func Warn(args ...any)

Warn logs to WARNING log. Arguments are handled in the manner of fmt.Print.

func Warnf

func Warnf(format string, args ...any)

Warnf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.

Types

type Logger

type Logger interface {
	// Debug logs to DEBUG log. Arguments are handled in the manner of fmt.Print.
	Debug(args ...any)
	// Debugf logs to DEBUG log. Arguments are handled in the manner of fmt.Printf.
	Debugf(format string, args ...any)
	// Info logs to INFO log. Arguments are handled in the manner of fmt.Print.
	Info(args ...any)
	// Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.
	Infof(format string, args ...any)
	// Warn logs to WARNING log. Arguments are handled in the manner of fmt.Print.
	Warn(args ...any)
	// Warnf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.
	Warnf(format string, args ...any)
	// Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.
	Error(args ...any)
	// Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
	Errorf(format string, args ...any)
	// Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print.
	Fatal(args ...any)
	// Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
	Fatalf(format string, args ...any)
}

Logger provides a unified logging interface.

Default borrows logging utilities from zap. The default log level is info level. The default output is standard output. You may replace it with whatever logger you like as long as it implements log.Logger interface.

Jump to

Keyboard shortcuts

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