xarleyn/dsh-plugins--packages-plugin-log ↗★ 1

@yadsh/dsh-plugin-log

提供结构化文件日志与运行时 logger 注册发现,统一插件日志输出 适合统一排障与日志归档需求的场景,需要由日志系统消费该能力

包名
@yadsh/dsh-plugin-log
兼容性
待验证
版本
0.2.1
许可证
MIT
最近更新
2026年9月13日

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗

@yadsh/dsh-plugin-log

Structured JSON or readable-text file logging for server-side DeepSeek Harness plugins, with daily rotation, retention, console mirroring, and runtime discovery.

import {
  createHostLoggerSink,
  getPluginLogger,
  getRegisteredPluginLoggers,
  setPluginLogFormat,
  setPluginLogLevel,
  subscribePluginLoggerRegistry,
} from "@yadsh/dsh-plugin-log";

const log = getPluginLogger({
  pluginId: "dsh-example",
  consoleSink: createHostLoggerSink(ctx.logger),
});
log.info("example.ready");

const unsubscribe = subscribePluginLoggerRegistry((loggers) => {
  console.info("active logger consumers", loggers);
});

setPluginLogLevel("dsh-example", "debug");
setPluginLogFormat("text");
unsubscribe();
await log.close();

The registry is process-wide and tracks active logger instances automatically. @yadsh/dsh-plugin-log-ui uses it to provide live defaults, per-plugin level overrides, and a json/text selector in DSH settings. See the repository's docs/PLUGIN_LOGGING.md for the complete behavior and API contract.

Development

pnpm --filter @yadsh/dsh-plugin-log check

License

MIT