arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Logger

Standard logging capabilities

The Logger capability provides WASM functions with the ability to log arbitrary data. Much like a traditional logger framework, this capability offers multiple log levels.

By default Debug and Trace level logs are disabled. To enable these log levels to consult the configuration options for Tarmac.

hashtag
Error

Critical errors within the system.

hashtag
Interface Details

Namespace
Capability
Function
Input
Output

hashtag
Warn

Non-critical errors within the system.

hashtag
Interface Details

Namespace
Capability
Function
Input
Output

hashtag
Info

Informational logs.

hashtag
Interface Details

Namespace
Capability
Function
Input
Output

hashtag
Debug

Request level errors & informational logs. Disabled by default, calls to Debug logging are ignored unless debug is enabled for the Tarmac host.

hashtag
Interface Details

Namespace
Capability
Function
Input
Output

hashtag
Trace

Low-level details of execution. Disabled by default, calls to Trace logging are ignored unless trace is enabled for the Tarmac host.

hashtag
Interface Details

Namespace
Capability
Function
Input
Output
_, err := wapc.HostCall("tarmac", "logger", "error", []byte("This is the data that should be logged"))

tarmac

logger

error

Log Message

nil

tarmac

logger

warn

Log Message

nil

tarmac

logger

info

Log Message

nil

tarmac

logger

debug

Log Message

nil

tarmac

logger

trace

Log Message

nil

_, err := wapc.HostCall("tarmac", "logger", "warn", []byte("This is the data that should be logged"))
_, err := wapc.HostCall("tarmac", "logger", "info", []byte("This is the data that should be logged"))
_, err := wapc.HostCall("tarmac", "logger", "debug", []byte("This is the data that should be logged"))
_, err := wapc.HostCall("tarmac", "logger", "trace", []byte("This is the data that should be logged"))