Preface

In DeepSeek Harness (DSH) plugin development, ctx.logger is the standard logging output interface. However, default configurations often do not attach log receivers. DSH includes a 1000-record in-memory buffer, but it has a hidden behavior: it silently drops logs at the warn and debug levels. This makes warnings emitted by plugins invisible. dsh-logbook aims to solve this problem by providing a /logs command and an enabled-by-default stderr exporter, making log output visible.

Plugin Overview

dsh-logbook is a DeepSeek Harness plugin. It is maintained by developer d3vmeh and licensed under the MIT License. It depends on the @deepseek-ai/schemastery and @deepseek-ai/cordis libraries, and the runtime requires Node.js 22 or later.

Installation and Enablement

The installation process is straightforward. Run the following command in your terminal to enable the plugin:

dsh plugin --profile web add dsh-logbook

After installation, the plugin automatically enables an stderr exporter. To adjust the number of retained log entries, output level, or mute specific loggers, modify the configuration file cordis.patch.yml.

Core Features

This plugin primarily addresses the issue of DSH’s default logs being invisible and provides the following capabilities:

  • Makes ctx.logger output visible.
  • Provides a built-in /logs command for viewing logs in the chat interface.
  • Enables an stderr exporter by default, writing logs to the standard error stream.
  • Supports /logs filtering by level, logger name, or regular expression matching.
  • Supports muting specific loggers.

Typical Usage and Configuration

After installation, you can use /logs directly in the chat window to view logs. Multiple parameter combinations are supported:

/logs
/logs --level warn
/logs --name llm-gate --grep queue
/logs --since 10m --limit 100

To control the stderr output level or mute specific loggers, edit cordis.patch.yml. For example:

- id: logs
  config:
    ring: 2000            # 记录保留数量
    stderr:
      enabled: true
      types:
        default: warn     # error | warn | info | debug | off
        llm-gate: debug   # 某个插件输出所有级别
        hmr: off          # 完全静音某个记录器

The values in the configuration represent logs at “this level and more severe”; the order is error > warn > info > debug.

Notes

Keep in mind the following when using it:

  1. Buffer behavior: DSH’s built-in buffer silently drops warn and debug records; only the /logs command can read the complete history.
  2. Pipeline stability: The stderr exporter is specially handled and will not crash due to pipeline closure.
  3. Known bug: Cordis has a known bug where the dispose method of ctx.logger.exporter() removes the most recently registered exporter rather than itself. This may cause log receivers from other plugins to be lost when a plugin is reloaded. dsh-logbook uses an internal flag to avoid duplicate reporting, but if multiple logging plugins are present, they may interfere with one another.

Summary

dsh-logbook provides a lightweight logging view solution that does not rely on a Web interface. It does not output to stdout, avoiding disruption to SDK and ACP protocol traffic. It is a practical tool for developers who need to troubleshoot issues in the terminal and chat interface.

See more details: GitHub repository | Community catalog