package logging
import "github.com/tetratelabs/wazero/internal/logging"
Package logging includes utilities used to log function calls. This is in an independent package to avoid dependency cycles.
Index ¶
- Constants
- func Config(fnd api.FunctionDefinition) (paramLoggers []ParamLogger, resultLoggers []ResultLogger)
- func WriteOOM(w Writer, offset uint32, byteCount uint32)
- func WriteStringOrOOM(mem api.Memory, w Writer, offset, byteCount uint32)
- type LogScopes
- type ParamLogger
- type ParamSampler
- type ResultLogger
- type ValWriter
- type ValueType
- type Writer
Constants ¶
const ( ValueTypeI32 = api.ValueTypeI32 ValueTypeI64 = api.ValueTypeI64 ValueTypeF32 = api.ValueTypeF32 ValueTypeF64 = api.ValueTypeF64 ValueTypeV128 ValueType = 0x7b // same as wasm.ValueTypeV128 ValueTypeFuncref ValueType = 0x70 // same as wasm.ValueTypeFuncref ValueTypeExternref = api.ValueTypeExternref // ValueTypeMemI32 is a non-standard type which writes ValueTypeI32 from the memory offset. ValueTypeMemI32 = 0xfd // ValueTypeMemH64 is a non-standard type which writes 64-bits fixed-width hex from the memory offset. ValueTypeMemH64 = 0xfe // ValueTypeString is a non-standard type describing an offset/len pair of a string. ValueTypeString = 0xff )
Functions ¶
func Config ¶
func Config(fnd api.FunctionDefinition) (paramLoggers []ParamLogger, resultLoggers []ResultLogger)
func WriteOOM ¶
func WriteStringOrOOM ¶
Types ¶
type LogScopes ¶
type LogScopes uint64
const ( LogScopeNone = LogScopes(0) LogScopeClock LogScopes = 1 << iota LogScopeProc LogScopeFilesystem LogScopeMemory LogScopePoll LogScopeRandom LogScopeSock LogScopeAll = LogScopes(0xffffffffffffffff) )
func (LogScopes) IsEnabled ¶
IsEnabled returns true if the scope (or group of scopes) is enabled.
func (LogScopes) String ¶
String implements fmt.Stringer by returning each enabled log scope.
type ParamLogger ¶
func NewParamLogger ¶
func NewParamLogger(offsetInStack uint32, name string, t ValueType) ParamLogger
type ParamSampler ¶
type ResultLogger ¶
func NewResultLogger ¶
func NewResultLogger(idx uint32, name string, t ValueType) ResultLogger
type ValWriter ¶
ValWriter formats an indexed value. For example, if `vals[i]` is a ValueTypeI32, this would format it by default as signed. If a ValueTypeString, it would read `vals[i+1]` and write the string from memory.
func ValWriterForType ¶
type ValueType ¶
ValueType is an extended form of api.ValueType, used to control logging in cases such as bitmasks or strings.
type Writer ¶
type Writer interface { io.Writer io.StringWriter io.ByteWriter }
Source Files ¶
- Version
- v1.9.0 (latest)
- Published
- Feb 18, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 4 days ago –
Tools for package owners.