Files
deepseek-harness/vendor/logger-console/src/index.ts
T
Tianyi Cui 72688a3888 Vendor Cordis framework packages as source
cordis 4.0.0-rc.6, plugin-loader, -include, -group, -timer, -hmr,
-logger-console, cosmokit 1.8.1, schemastery 3.18.0 — copied from the
cordis-workspace checkout, flattened under vendor/, original npm names,
private: true. vendor/README.md is the manifest: upstream repos +
commit SHAs, local-modification log, sync procedure.

Local modification: hmr's locale YAML imports and .i18n() call removed
(avoids a runtime YAML import hook we don't vendor).
2026-06-11 10:53:32 +08:00

29 lines
851 B
TypeScript

import { Formatter } from 'cordis'
import { inspect } from 'node:util'
import supportsColor from 'supports-color'
import { ConsoleExporter as Base } from './shared.js'
/** Re-export shared console exporter config and base implementation. */
export * from './shared.js'
const inspectFormatter: Formatter = (value, target) => {
return inspect(value, { colors: !!target.colors, depth: Infinity, compact: true, breakLength: Infinity })
}
/** Node console exporter with `util.inspect` object formatting. */
export class ConsoleExporter extends Base {
formatters: Record<string, Formatter> = {
o: inspectFormatter,
O: inspectFormatter,
}
getDefaults() {
return {
...super.getDefaults(),
colors: (supportsColor.stdout ? supportsColor.stdout.level : 0) as false | 0 | 1 | 2 | 3,
}
}
}
export default ConsoleExporter