-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
This issue is made of two parts:
- Amend The go-pdk documentation at this line:
Line 196 in de6b7b8
pdk.Log(pdk.LogWarn, "A trace log!") "A warn log!"
- Remove LogTrace as it does not seem to be exposed on the Extism CLI side and does not come up even if the log level is set to
--log-level=trace
. Here is an example:
//export log_stuff
func logStuff() int32 {
pdk.Log(pdk.LogInfo, "An info log!")
pdk.Log(pdk.LogDebug, "A debug log!")
pdk.Log(pdk.LogWarn, "A warn log!")
pdk.Log(pdk.LogError, "An error log!")
pdk.Log(pdk.LogTrace, "A trace log!")
return 0
}
func main() {}
Compile it onto .wasm
:
tinygo build -o plugin.wasm -target wasi main.go
and finally:
extism call plugin.wasm log_stuff --wasi --log-level=trace
2024/07/12 23:48:44 No runtime detected
2024/07/12 23:48:44 Calling function : log_stuff
2024/07/12 23:48:44 An info log!
2024/07/12 23:48:44 A debug log!
2024/07/12 23:48:44 A warn log!
2024/07/12 23:48:44 An error log!
Metadata
Metadata
Assignees
Labels
No labels