logs

package
v0.0.0-...-27a102d Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Adorn

func Adorn(m logrus.Fields)

Adorn adds the fields to Log variable

func CreateContextForLogging

func CreateContextForLogging(ctx context.Context, transactionId string, threadName string, actionID string, actionName string, podName string) context.Context

CreateContextForLogging is to get the context with all the parameters those needed for log

func LogWithFields

func LogWithFields(ctx context.Context) *logrus.Entry

LogWithFields add fields to log

func SetLogFormat

func SetLogFormat(format LogFormat)

SetLogFormat sets the giving input as logging format

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel sets the given input as log level

Types

type LogFormat

type LogFormat uint32

LogFormat is custom type created for the log formats supported by ODIM

const (
	SyslogFormat LogFormat = iota
	JSONFormat
)

log formats supported by ODIM

func ParseLogFormat

func ParseLogFormat(format string) (LogFormat, error)

ParseLogFormat takes a string level and returns the log format.

func (LogFormat) MarshalText

func (format LogFormat) MarshalText() ([]byte, error)

MarshalText will validate the log format and return the corresponding string

func (LogFormat) String

func (format LogFormat) String() string

Convert the log format to a string.

func (*LogFormat) UnmarshalText

func (format *LogFormat) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type SysLogFormatter

type SysLogFormatter struct{}

SysLogFormatter implements logrus Format interface. It provides a formatter for odim in syslog format

func (*SysLogFormatter) Format

func (f *SysLogFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format renders a log in syslog format

Jump to

Keyboard shortcuts

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