.log
Liatir.log provides structured logging for plugins. Every log entry is tagged with the current job ID and streamed in real time to the Liatir Jobs UI, where users can inspect, filter, and export logs.
Logs are also appended to the job's stderr buffer, so they appear in jobs.getOutput() alongside process output.
Methods
| Level | Node | Python | R | Native Rust |
|---|---|---|---|---|
| Information | log.info(message, meta?) | log.info(message, meta=None) | log$info(message, meta=NULL) | log().info(message, meta)? |
| Warning | log.warn(message, meta?) | log.warn(message, meta=None) | log$warn(message, meta=NULL) | log().warn(message, meta)? |
| Error | log.error(message, meta?) | log.error(message, meta=None) | log$error(message, meta=NULL) | log().error(message, meta)? |
| Debug | log.debug(message, meta?) | log.debug(message, meta=None) | log$debug(message, meta=NULL) | log().debug(message, meta)? |
R uses ctx$liatir$log$info(message, meta = NULL) (and the same signature for warn, error, debug). Native Rust uses ctx.liatir.log().info(message: &str, meta: Value) -> Result<Value>; metadata is mandatory there, so pass json!({}) or json!(null) when unused. Logging an error records a message; propagate an error or stop execution separately when the Plugin must fail.
Parameters
| Parameter | Description |
|---|---|
message | Human-readable text; a string in every SDK. |
meta | Structured JSON metadata: a Node object, Python dict, R named list or Native serde_json::Value. |
Examples
Basic logging
Logging inside a long-running job
Log levels
| Level | Color in UI | Use case |
|---|---|---|
info | Blue | Normal operational messages |
warn | Yellow | Non-fatal issues the user should be aware of |
error | Red | Failures that prevented an operation from completing |
debug | Gray | Verbose diagnostic output for development |
Notes
IMPORTANT
JSON response fields are always camelCase in Node, Python, R and Native.
- Log entries are emitted as Tauri events (
jobs:log:{jobId}) and displayed in real time in the Jobs UI. - Each entry includes a timestamp (Unix epoch milliseconds) added by the backend.
- The
metafield accepts any JSON-serializable object — use it to attach structured context (file paths, counts, error codes) that the UI or downstream tools can parse. - Logs are persisted in the job's stderr buffer and can be retrieved via
jobs.getOutput().