logger

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Logger Interface Use instance of logger instead of exported functions

usage example

import (

"errors"
"github.com/rudderlabs/rudder-server/utils/logger"

)

var log logger.LoggerI = &logger.LoggerT{}

or

var log logger.LoggerI = logger.NewLogger()

...

log.Error(...)

Index

Constants

This section is empty.

Variables

Functions

func GetLoggingConfig added in v0.1.10

func GetLoggingConfig() map[string]int

func Init added in v0.1.10

func Init()

Setup sets up the logger initially

func SetModuleLevel added in v0.1.10

func SetModuleLevel(module, levelStr string) error

SetModuleLevel sets log level for a module and it's children Pass empty string for module parameter for resetting root logging level

Types

type LoggerI added in v0.1.10

type LoggerI interface {
	IsDebugLevel() bool
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Fatal(args ...interface{})
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	LogRequest(req *http.Request)
	Child(s string) LoggerI
}

type LoggerT added in v0.1.10

type LoggerT struct {
	// contains filtered or unexported fields
}

func NewLogger added in v0.1.10

func NewLogger() *LoggerT

func (*LoggerT) Child added in v0.1.10

func (l *LoggerT) Child(s string) LoggerI

func (*LoggerT) Debug added in v0.1.10

func (l *LoggerT) Debug(args ...interface{})

Debug level logging. Most verbose logging level.

func (*LoggerT) Debugf added in v0.1.10

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

Debugf does debug level logging similar to fmt.Printf. Most verbose logging level

func (*LoggerT) Error added in v0.1.10

func (l *LoggerT) Error(args ...interface{})

Error level logging. Use this to log errors which dont immediately halt the application.

func (*LoggerT) Errorf added in v0.1.10

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

Errorf does error level logging similar to fmt.Printf. Use this to log errors which dont immediately halt the application.

func (*LoggerT) Fatal added in v0.1.10

func (l *LoggerT) Fatal(args ...interface{})

Fatal level logging. Use this to log errors which crash the application.

func (*LoggerT) Fatalf added in v0.1.10

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

Fatalf does fatal level logging similar to fmt.Printf. Use this to log errors which crash the application.

func (*LoggerT) Info added in v0.1.10

func (l *LoggerT) Info(args ...interface{})

Info level logging. Use this to log the state of the application. Dont use Logger.Info in the flow of individual events. Use Logger.Debug instead.

func (*LoggerT) Infof added in v0.1.10

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

Infof does info level logging similar to fmt.Printf. Use this to log the state of the application. Dont use Logger.Info in the flow of individual events. Use Logger.Debug instead.

func (*LoggerT) IsDebugLevel added in v0.1.10

func (l *LoggerT) IsDebugLevel() bool

IsDebugLevel Returns true is debug lvl is enabled

func (*LoggerT) LogRequest added in v0.1.10

func (l *LoggerT) LogRequest(req *http.Request)

LogRequest reads and logs the request body and resets the body to original state.

func (*LoggerT) Warn added in v0.1.10

func (l *LoggerT) Warn(args ...interface{})

Warn level logging. Use this to log warnings

func (*LoggerT) Warnf added in v0.1.10

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

Warnf does warn level logging similar to fmt.Printf. Use this to log warnings

Jump to

Keyboard shortcuts

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