Skip to content

Remove Log.Trace as it is not exposed on the Extism CLI #37

@hilaryRope

Description

@hilaryRope

This issue is made of two parts:

  • Amend The go-pdk documentation at this line:
    pdk.Log(pdk.LogWarn, "A trace log!")
    as it should read "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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions