tdsk-logger

Documents the Winston-based logging package with CLI logger, API logger, and secret redaction.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/threadedstack/threadedstack --skill tdsk-logger-threadedstack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdsk-logger
Source: https://github.com/threadedstack/threadedstack/tree/main/.claude/skills/tdsk-logger
Command: npx skills add https://github.com/threadedstack/threadedstack --skill tdsk-logger-threadedstack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires winston, express-winston, @keg-hub/parse-config, @keg-hub/jsutils.

What problem does it solve? Developers working with the @tdsk/logger package need to understand its two logger systems, Express middleware setup, secret redaction behavior, and environment loading without reading the entire source tree. ## Core Features & Use Cases - Dual Logger Systems: Documents the CLI Logger (colored console output with headers, tables, and tags) and the API Logger (Winston structured logging via buildApiLogger). - Express Middleware: Covers setupLoggerReq and setupLoggerErr for request and error logging via express-winston. - Secret Redaction: Explains multi-layer redaction of passwords, tokens, API keys, and credit cards through safeReplacer and stderr interception. - Use Case: When integrating logging into a backend service, consult this Skill to correctly configure ApiLogger, attach Express middleware, and inject runtime secrets into the redaction list. ## Quick Start Ask how to set up structured Winston logging with secret redaction in an Express backend using the @tdsk/logger package.

Frequently Asked Questions about tdsk-logger

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

FAQPage Schema
How do I set up Winston logging in an Express app?▼

Use setupLoggerReq(app) for request logging and setupLoggerErr(app) for error logging, both built on express-winston. Create the logger with buildApiLogger(label, level) or use the default ApiLogger singleton.

How do I redact secrets from Node.js console output?▼

The package intercepts process.stdout.write and process.stderr.write via stdio.ts and applies replaceUnsafe to strip passwords, tokens, API keys, and credit cards. Use injectKeyValues or injectUnsafe to add runtime secrets to the redaction list.

Why do debug and verbose logs show as info level in Winston?▼

This is a known behavior of the API Logger: debug(), verbose(), and silly() all map internally to the Winston info level. Use the CLI Logger's state methods if you need visually distinct output levels.

Can I disable secret redaction for debugging?▼

Yes, set the environment variable STL_FORCE_DISABLE_SAFE=true to bypass stderr redaction. Use this only in controlled environments since secrets will appear in plain text output.

How do I load environment variables from config files in Node.js?▼

Call loadEnvs(cfg) which uses @keg-hub/parse-config to search the project root, deploy/, and ~/.config/tdsk/ directories. Results are cached in __LOADED_ENVS__; pass force: true to reload.