Documentation
¶
Overview ¶
Package fields provides blockchain-specific logging field helpers.
These helpers create structured fields with consistent naming for blockchain-related data like transactions, blocks, shards, and timing.
Usage:
import "github.com/JupiterMetaLabs/ion/fields"
logger.Info("transaction routed",
fields.TxHash("abc123"),
fields.ShardID(5),
fields.LatencyMs(12.5),
)
Index ¶
- func Address(addr string) ion.Field
- func BlockHash(hash string) ion.Field
- func BlockHeight(height uint64) ion.Field
- func ChainID(id string) ion.Field
- func Component(name string) ion.Field
- func Count(n int) ion.Field
- func DurationMs(ms float64) ion.Field
- func DurationSec(sec float64) ion.Field
- func Enabled(on bool) ion.Field
- func Epoch(epoch uint64) ion.Field
- func ErrorMsg(err error) ion.Field
- func FromAddress(addr string) ion.Field
- func GasLimit(limit uint64) ion.Field
- func GasPrice(price uint64) ion.Field
- func GasUsed(used uint64) ion.Field
- func Host(host string) ion.Field
- func LatencyMs(ms float64) ion.Field
- func Method(method string) ion.Field
- func Network(net string) ion.Field
- func NodeID(id string) ion.Field
- func Nonce(n uint64) ion.Field
- func Operation(op string) ion.Field
- func Pending(n int) ion.Field
- func Port(port int) ion.Field
- func Reason(r string) ion.Field
- func RemoteAddr(addr string) ion.Field
- func ReplicaIndex(idx int) ion.Field
- func Score(s float64) ion.Field
- func ShardID(id int) ion.Field
- func Size(bytes int64) ion.Field
- func Slot(slot uint64) ion.Field
- func Success(ok bool) ion.Field
- func ToAddress(addr string) ion.Field
- func Total(n int) ion.Field
- func TxHash(hash string) ion.Field
- func TxSignature(sig string) ion.Field
- func TxStatus(status string) ion.Field
- func TxType(txType string) ion.Field
- func Value(val string) ion.Field
- func Weight(w float64) ion.Field
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockHeight ¶
BlockHeight creates a block height field.
func DurationMs ¶
DurationMs creates a duration field in milliseconds.
func DurationSec ¶
DurationSec creates a duration field in seconds.
func ErrorMsg ¶ added in v0.1.4
ErrorMsg creates an error message field for non-fatal error logging. Use this when logging at Warn level where the error parameter isn't available. For Error level, prefer using the error parameter: log.Error(ctx, msg, err, ...)
func FromAddress ¶ added in v0.1.4
FromAddress creates a "from" address field.
func ReplicaIndex ¶
ReplicaIndex creates a replica index field.
func TxSignature ¶
TxSignature creates a transaction signature field.
Types ¶
This section is empty.