golem-logging-scala

Implements structured logging in Scala Golem agents via the wasi:logging interface.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-logging-scala
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-logging-scala
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/scala/golem-logging-scala
Command: npx skills add https://github.com/golemcloud/golem --skill golem-logging-scala

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scala developers building Golem agents need a typed, level-aware way to emit log output that integrates with Golem's oplog and streaming tools, instead of relying on unstructured println statements.

Core Features & Use Cases

  • Typed Logging Facade: Use the golem.wasi.Logging object with methods for trace, debug, info, warn, error, and critical levels mapped to the wasi:logging/logging WASI interface.
  • Context-Scoped Log Entries: Attach optional context strings to group and filter log entries by subsystem, such as "db" or "http-client".
  • Use Case: While debugging a Scala agent that processes orders, add Logging.info and Logging.error calls with context tags, then run golem agent stream to watch live, filterable output during invocations.

Quick Start

Add logging to my Scala Golem agent using golem.wasi.Logging and show me how to view the output with golem agent stream.

Frequently Asked Questions about golem-logging-scala

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add logging to a Scala Golem agent?

Import golem.wasi.Logging and call methods like Logging.info, Logging.debug, or Logging.error directly with no setup required. The Logging object comes from golem-scala-core, which is already included in the project dependencies.

What log levels does golem.wasi.Logging support?

The Logging object supports six levels: trace, debug, info, warn, error, and critical. Each method maps directly to the corresponding level in the wasi:logging/logging WASI interface.

Can I use println instead of wasi:logging in a Golem agent?

Yes, println and System.err.println work and are captured by Golem, appearing in golem agent stream output. However, they lack log levels and context, so Logging methods are preferred for structured, filterable output.

How do I view logs from a running Golem agent?

Run golem agent stream '<agent-id>' to watch live agent output, or use golem agent invoke with the agent ID and method to see logs during a specific invocation. All log entries are recorded in the agent's oplog.

What happens to log calls during Golem agent replay?

Logging is treated as a side effect, so during replay after a crash recovery, log calls from replayed operations are skipped. This prevents duplicate log entries when the agent re-executes its history.