Documentation
¶
Index ¶
- Constants
- Variables
- func AppendRequestId(ctx context.Context, reqId string) context.Context
- func AppendTaskId(ctx context.Context, taskId string) context.Context
- func AppendTxId(ctx context.Context, txId string) context.Context
- func AppendUniqueIdentifier(ctx context.Context, guid uint64) context.Context
- func Btof(b bool) float64
- func Deserialize(raw []byte, data any)
- func ExtractWantedHeadersFromCachedMap(headers map[string][]string, ctx context.Context) context.Context
- func FormatLongString(msg string, maxCharacters int) string
- func FormatStringerList[T fmt.Stringer](description string, listToPrint []T, separator string) string
- func GenerateUniqueIdentifier() uint64
- func GetRequestId(ctx context.Context) (reqId string, found bool)
- func GetTaskId(ctx context.Context) (taskId string, found bool)
- func GetTxId(ctx context.Context) (txId string, found bool)
- func GetUniqueIdentifier(ctx context.Context) (guid uint64, found bool)
- func IsDebugEnabled() bool
- func IsMiddleOfMonthPassed(date time.Time) bool
- func IsTraceLogLevelEnabled() 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 LavaFormatTrace(description string, attributes ...Attribute) error
- func LavaFormatWarning(description string, err error, attributes ...Attribute) error
- func Max[T cmp.Ordered](x, y T) T
- func Min[T cmp.Ordered](x, y T) T
- func NextMonth(date time.Time) time.Time
- func RollingLoggerSetup(rollingLogLevel string, filePath string, maxSize string, maxBackups string, ...) func()
- func SafeUint64ToInt64Convert(val uint64) int64
- func Serialize(data any) []byte
- func SetGlobalLoggingLevel(logLevel string)
- func SetLogLevelFieldName(fieldName string)
- func StrValue(val interface{}) string
- func StrValueForLog(val interface{}, key string, idx int, attributes []Attribute) string
- func ToHexString(hash string) string
- func WithRequestId(ctx context.Context, reqId string) context.Context
- func WithTaskId(ctx context.Context, taskId string) context.Context
- func WithTxId(ctx context.Context, txId string) context.Context
- func WithUniqueIdentifier(ctx context.Context, guid uint64) context.Context
- type Attribute
- type ChanneledWaitGroup
- type LavaMutex
- type Lockable
- type LoggerWrapper
Constants ¶
const ( LAVA_LOG_TRACE = iota LAVA_LOG_DEBUG LAVA_LOG_INFO LAVA_LOG_WARN LAVA_LOG_ERROR LAVA_LOG_FATAL LAVA_LOG_PANIC LAVA_LOG_PRODUCTION NoColor = true )
const ( KEY_REQUEST_ID = "request_id" KEY_TASK_ID = "task_id" KEY_TRANSACTION_ID = "tx_id" )
const (
EventPrefix = "lava_"
)
const MONTHS_IN_YEAR = 12
const TIMEOUT = 10
Variables ¶
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" )
var ( TimeoutMutex = "false" TimeoutMutexBoolean, _ = strconv.ParseBool(TimeoutMutex) )
var DebugPaymentE2E = "" // using "debug_payment_e2e" build option, this string will be "debug_payment_e2e"
Functions ¶
func AppendUniqueIdentifier ¶
func Deserialize ¶
func ExtractWantedHeadersFromCachedMap ¶
func ExtractWantedHeadersFromCachedMap(headers map[string][]string, ctx context.Context) context.Context
ExtractWantedHeadersFromCachedMap extracts specific headers from a pre-cached headers map and adds them to the Go context. This avoids repeated header lookups when headers are already cached via GetReqHeaders().
func FormatLongString ¶
func FormatStringerList ¶
func GenerateUniqueIdentifier ¶
func GenerateUniqueIdentifier() uint64
func IsDebugEnabled ¶
func IsDebugEnabled() bool
IsDebugEnabled reports whether debug-level logging is currently active. Use this to guard expensive pre-call computations that are only needed when a debug log will actually be emitted.
func IsMiddleOfMonthPassed ¶
func IsTraceLogLevelEnabled ¶
func IsTraceLogLevelEnabled() bool
func LavaFormatDebug ¶
func LavaFormatError ¶
func LavaFormatFatal ¶
func LavaFormatInfo ¶
func LavaFormatLog ¶
func LavaFormatPanic ¶
func LavaFormatProduction ¶
see documentation in LavaFormatLog function
func LavaFormatTrace ¶
func LavaFormatWarning ¶
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 SetLogLevelFieldName ¶
func SetLogLevelFieldName(fieldName string)
func StrValueForLog ¶
func ToHexString ¶
Types ¶
type Attribute ¶
type Attribute struct {
Key string
Value interface{}
}
func StringMapToAttributes ¶
type ChanneledWaitGroup ¶
func NewChanneledWaitGroup ¶
func NewChanneledWaitGroup() *ChanneledWaitGroup
func (*ChanneledWaitGroup) Wait ¶
func (wg *ChanneledWaitGroup) Wait() <-chan struct{}
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
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package specfetcher provides functionality to fetch Lava specs from remote Git repositories.
|
Package specfetcher provides functionality to fetch Lava specs from remote Git repositories. |