Documentation ¶
Index ¶
- Constants
- Variables
- func AppendUniqueIdentifier(ctx context.Context, guid uint64) context.Context
- func Deserialize(raw []byte, data any)
- func FormatLongString(msg string, maxCharacters int) string
- func FormatStringerList[T fmt.Stringer](description string, listToPrint []T, separator string) string
- func GenerateUniqueIdentifier() uint64
- func GetUniqueIdentifier(ctx context.Context) (guid uint64, found bool)
- func LavaFormatDebug(description string, attributes ...Attribute) error
- func LavaFormatError(description string, err error, attributes ...Attribute) error
- func LavaFormatFatal(description string, err error, attributes ...Attribute)
- func LavaFormatInfo(description string, attributes ...Attribute) error
- func LavaFormatLog(description string, err error, attributes []Attribute, severity uint) error
- func LavaFormatPanic(description string, err error, attributes ...Attribute)
- func LavaFormatProduction(description string, err error, attributes ...Attribute) error
- func LavaFormatWarning(description string, err error, attributes ...Attribute) error
- func LogLavaEvent(ctx sdk.Context, logger log.Logger, name string, attributes map[string]string, ...)
- func NextMonth(date time.Time) time.Time
- func RollingLoggerSetup(rollingLogLevel string, filePath string, maxSize string, maxBackups string, ...) func()
- func Serialize(data any) []byte
- func SetGlobalLoggingLevel(logLevel string)
- func StrValue(val interface{}) string
- func StrValueForLog(val interface{}, key string, idx int, attributes []Attribute) string
- func ValidateCoins(ctx sdk.Context, denom string, coins sdk.Coin, allowZero bool) error
- func WithUniqueIdentifier(ctx context.Context, guid uint64) context.Context
- type Attribute
- type LavaMutex
- type Lockable
- type LoggerWrapper
Constants ¶
View Source
const ( LAVA_LOG_DEBUG = iota LAVA_LOG_INFO LAVA_LOG_WARN LAVA_LOG_ERROR LAVA_LOG_FATAL LAVA_LOG_PANIC NoColor = true )
View Source
const (
EventPrefix = "lava_"
)
View Source
const MONTHS_IN_YEAR = 12
View Source
const TIMEOUT = 10
Variables ¶
View Source
var ( JsonFormat = false // if set to production, this will replace some errors to warning that can be caused by misuse instead of bugs ExtendedLogLevel = "development" )
View Source
var ( TimeoutMutex = "false" TimeoutMutexBoolean, _ = strconv.ParseBool(TimeoutMutex) )
View Source
var DebugPaymentE2E = "" // using "debug_payment_e2e" build option, this string will be "debug_payment_e2e"
Functions ¶
func AppendUniqueIdentifier ¶
func Deserialize ¶
func FormatLongString ¶
func FormatStringerList ¶
func GenerateUniqueIdentifier ¶
func GenerateUniqueIdentifier() uint64
func LavaFormatDebug ¶
func LavaFormatError ¶
func LavaFormatFatal ¶
func LavaFormatInfo ¶
func LavaFormatLog ¶
func LavaFormatPanic ¶
func LavaFormatProduction ¶
depending on the build flag, this log function will log either a warning or an error. the purpose of this function is to fail E2E tests and not allow unexpected behavior to reach main. while in production some errors may occur as consumers / providers might set up their processes in the wrong way. in test environment we dont expect to have these errors and if they occur we would like to fail the test.
func LavaFormatWarning ¶
func LogLavaEvent ¶
func NextMonth ¶
NextMonth returns the date of the same day next month (assumes UTC), adjusting for end-of-months differences if needed.
func RollingLoggerSetup ¶
func SetGlobalLoggingLevel ¶
func SetGlobalLoggingLevel(logLevel string)
func StrValueForLog ¶
func ValidateCoins ¶
Types ¶
type Attribute ¶
type Attribute struct { Key string Value interface{} }
func StringMapToAttributes ¶
type LavaMutex ¶
type LavaMutex struct { SecondsLeft int // contains filtered or unexported fields }
type LoggerWrapper ¶
type LoggerWrapper struct {
LoggerName string
}
this logger is used for any third party loggers that require the logging functionality to be a bit different than the lava logger functionality
func (LoggerWrapper) Debugf ¶
func (lw LoggerWrapper) Debugf(msg string, extraInfo ...interface{})
func (LoggerWrapper) Errorf ¶
func (lw LoggerWrapper) Errorf(msg string, extraInfo ...interface{})
func (LoggerWrapper) Infof ¶
func (lw LoggerWrapper) Infof(msg string, extraInfo ...interface{})
func (LoggerWrapper) Warningf ¶
func (lw LoggerWrapper) Warningf(msg string, extraInfo ...interface{})
Source Files ¶
Click to show internal directories.
Click to hide internal directories.