@davidwells/smart-log is a logging layer for command-line tools and automation scripts.
It supports normal user-facing logs, debug namespaces, JSON output for programmatic callers, silent mode, and log dumping for later inspection.
Good CLI tools need to be useful for humans and machines. The same command may need readable terminal output for a developer, structured JSON for another tool, or a complete debug log for a failing automation run.
DEBUG or --debug.--silent mode for quiet automation.--json output for downstream tools and agents.console.log calls route through the same policy.npm install @davidwells/smart-logconst { _console, debug, setJson } = require('@davidwells/smart-log')
const logHttp = debug('app:http')
_console.log('Starting job')
logHttp('request received')
setJson(true)
_console.json({ ok: true }, 'Result')