logs

package
v1.206.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FatalLevel = log.FatalLevel
	ErrorLevel = log.ErrorLevel
	WarnLevel  = log.WarnLevel
	InfoLevel  = log.InfoLevel
	DebugLevel = log.DebugLevel
)

Variables

This section is empty.

Functions

func ClearInfo

func ClearInfo()

func DisableLogging added in v1.183.0

func DisableLogging()

func ErrorMsg

func ErrorMsg(message string)

func ErrorWithFields

func ErrorWithFields(fields map[string]interface{}, err error)

func ErrorWithMsg

func ErrorWithMsg(message string, err error)

func FilterSensitiveWordsMap

func FilterSensitiveWordsMap(s string, wordsMap map[string]bool) (filtered string, changed bool)

func Info

func Info(format string, a ...interface{})

func InfoWithFields

func InfoWithFields(fields map[string]interface{}, message interface{})

func InitLogs

func InitLogs(requestID *string, isDebugBuild bool, buildVersion string, request *events.APIGatewayProxyRequest, client *raygun4go.Client)

func LogAllStoredLogs added in v1.184.0

func LogAllStoredLogs()

func LogApiAudit

func LogApiAudit(fields log.Fields)

func LogLevel

func LogLevel() log.Level

func LogRequestInfo

func LogRequestInfo(req events.APIGatewayProxyRequest, shouldExcludeBody bool, extraFields map[string]interface{})

func LogResponseInfo added in v1.134.0

func LogResponseInfo(req events.APIGatewayProxyRequest, res events.APIGatewayProxyResponse, err error)

func LogSQSEvent

func LogSQSEvent(event events.SQSEvent)

func LogShipmentID

func LogShipmentID(id int64)

func MaskByteArraysInJsonString added in v1.169.0

func MaskByteArraysInJsonString(jsonString string) string

MaskByteArraysInJsonString takes a string and truncates all the instances of number array fields have the word "byte" in the name. E.g. {"file_bytes": [123,68,103]} will become "{"file_bytes": [...]}"

func MaskPasswordsInJsonString added in v1.101.0

func MaskPasswordsInJsonString(jsonString string) string

MaskPasswordsInJsonString takes a string and sanitises all the instances of fields named password. E.g. "{"password": "xyz123"}" will become "{"password": "***"}"

func SQLDebugInfo

func SQLDebugInfo(sql string)

func SanitiseFields added in v1.101.0

func SanitiseFields(fields map[string]interface{}) map[string]interface{}

func SanitiseLogs added in v1.101.0

func SanitiseLogs(logString string) string

func SetLevel added in v1.190.0

func SetLevel(logLevel log.Level)

func SetOutput added in v1.183.0

func SetOutput(out io.Writer)

func SetOutputToFile

func SetOutputToFile(file *os.File)

func StoreLogsUntilTriggered added in v1.184.0

func StoreLogsUntilTriggered(storeLogs bool)

func TableNameForQuery added in v1.153.0

func TableNameForQuery(event *bun.QueryEvent) string

func Warn

func Warn(format string, a ...interface{})

func WarnWithFields

func WarnWithFields(fields map[string]interface{}, err error)

Types

type CustomLogFormatter added in v1.134.0

type CustomLogFormatter struct {
}

func (*CustomLogFormatter) Format added in v1.134.0

func (f *CustomLogFormatter) Format(entry *log.Entry) ([]byte, error)

type LogEntryWithLevel added in v1.184.0

type LogEntryWithLevel struct {
	// LogBuffer *bytes.Buffer
	LogEntry *log.Entry
	Message  interface{}
	LogLevel log.Level
}

type QueryHook added in v1.134.0

type QueryHook struct {
	IgnoredTableInserts []string
	Debug               bool
}

func (QueryHook) AfterQuery added in v1.134.0

func (d QueryHook) AfterQuery(_ context.Context, event *bun.QueryEvent)

func (QueryHook) BeforeQuery added in v1.134.0

func (d QueryHook) BeforeQuery(ctx context.Context, _ *bun.QueryEvent) context.Context

Jump to

Keyboard shortcuts

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