log

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package log is the legacy logging package.

Deprecated: use github.com/imdm/go-util/logging instead. New code should not import this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug deprecated

func Debug(args ...interface{})

Debug prints a debug-level log by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Debug instead.

func Debugf deprecated

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

Debugf prints a debug-level log with format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Debug with structured fields instead.

func Debugw deprecated

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

Debugw prints a debug-level log with json-format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Debug with structured fields instead.

func Error deprecated

func Error(args ...interface{})

Error prints a error-level log by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Error instead.

func Errorf deprecated

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

Errorf prints a error-level log with format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Error with structured fields instead.

func Errorw deprecated

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

Errorw prints a error-level log with json-format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Error with structured fields instead.

func Fatal deprecated

func Fatal(args ...interface{})

Fatal prints a fatal-level log by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Fatal instead.

func Fatalf deprecated

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

Fatalf prints a fatal-level log with format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Fatal instead.

func Fatalw deprecated

func Fatalw(msg string, kvs ...interface{})

Fatalw prints a fatal-level log with json-format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Fatal instead.

func Info deprecated

func Info(args ...interface{})

Info prints a info-level log by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Info instead.

func Infof deprecated

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

Infof prints a info-level log with format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Info with structured fields instead.

func Infow deprecated

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

Infow prints a info-level log with json-format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Info with structured fields instead.

func Panic deprecated

func Panic(args ...interface{})

Panic prints a panic-level log by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Error plus panic handling instead.

func Panicf deprecated

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

Panicf prints a panic-level log with format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Error plus panic handling instead.

func Panicw deprecated

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

Panicw prints a panicw-level log with json-format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Error plus panic handling instead.

func SetDefault deprecated

func SetDefault(l *Logger)

SetDefault sets the default logger instance.

Deprecated: use github.com/imdm/go-util/logging.SetDefaultLogger instead.

func Warn deprecated

func Warn(args ...interface{})

Warn prints a warn-level log by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Warn instead.

func Warnf deprecated

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

Warnf prints a warn-level log with format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Warn with structured fields instead.

func Warnw deprecated

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

Warnw prints a warn-level log with json-format by default logger instance.

Deprecated: use github.com/imdm/go-util/logging.Logger.Warn with structured fields instead.

Types

type Logger deprecated

type Logger struct {
	*zap.SugaredLogger
	// contains filtered or unexported fields
}

Logger wraps zap.SugaredLogger with two output cores: a rotate file and color console. It also registers a custom metrics collection hook.

Deprecated: use github.com/imdm/go-util/logging.Logger instead.

func Default deprecated

func Default() *Logger

Default returns a default logger instance.

Deprecated: use github.com/imdm/go-util/logging.DefaultLogger instead.

func New deprecated

func New(options ...Option) *Logger

New returns a Logger instance.

Deprecated: use github.com/imdm/go-util/logging.MustNewLogger or NewLogger instead.

type Option deprecated

type Option func(*Logger)

Option configures a logger.

Deprecated: use github.com/imdm/go-util/logging.Config instead.

func WithConsoleLog deprecated

func WithConsoleLog(b bool) Option

WithConsoleLog returns a Option that sets the logger's consoleLog field. If consoleLog equals to true, the logger will output log to console.

Deprecated: use github.com/imdm/go-util/logging.Config.Format instead.

func WithFileLog deprecated

func WithFileLog(b bool) Option

WithFileLog returns a Option that sets the logger's fileLog field. If fileLog equals to true, the logger will output log to file.

Deprecated: use github.com/imdm/go-util/logging.Config plus a custom writer instead.

func WithFilePath deprecated

func WithFilePath(p string) Option

WithFilePath returns a Option that sets the logger's path field. path is file path of fileLog. It only takes effect when fileLog equals to true.

Deprecated: use github.com/imdm/go-util/logging.Config plus a custom writer instead.

func WithLevel deprecated

func WithLevel(lvl string) Option

WithLevel returns a Option that sets the logger's level field.

Deprecated: use github.com/imdm/go-util/logging.Config.Level instead.

Jump to

Keyboard shortcuts

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