xarleyn/dsh-plugins--packages-plugin-log ↗★ 1
@yadsh/dsh-plugin-log
Shared structured file logging and runtime logger discovery for DSH plugins 适合统一排障与日志归档需求的场景,需要由日志系统消费该能力
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full 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