Files
ParzivalTD 06661525f8 Deploy: TekDek Command Center (2026-04-13)
- Complete Node.js + PostgreSQL application
- 10 REST API endpoints (CRUD for projects/tasks)
- Responsive HTML/CSS/JavaScript UI
- Production-ready code (95%+ test coverage)
- Deployed to /publish/web1/public/command-center/
- Server running on port 3000

Pipeline: Daedalus (arch) → Talos (code) → Icarus (UI) → Hephaestus (deploy)
Total time: 30 minutes
Token efficiency: ~783k tokens (~$6.65)

Documentation: DEPLOYMENT-POSTMORTEM-2026-04-13.md
2026-04-13 12:50:40 -04:00

53 lines
1.2 KiB
JavaScript

'use strict';
const { Colorizer } = require('./colorize');
const { Padder } = require('./pad-levels');
const { configs, MESSAGE } = require('triple-beam');
/**
* Cli format class that handles initial state for a a separate
* Colorizer and Padder instance.
*/
class CliFormat {
constructor(opts = {}) {
if (!opts.levels) {
opts.levels = configs.cli.levels;
}
this.colorizer = new Colorizer(opts);
this.padder = new Padder(opts);
this.options = opts;
}
/*
* function transform (info, opts)
* Attempts to both:
* 1. Pad the { level }
* 2. Colorize the { level, message }
* of the given `logform` info object depending on the `opts`.
*/
transform(info, opts) {
this.colorizer.transform(
this.padder.transform(info, opts),
opts
);
info[MESSAGE] = `${info.level}:${info.message}`;
return info;
}
}
/*
* function cli (opts)
* Returns a new instance of the CLI format that turns a log
* `info` object into the same format previously available
* in `winston.cli()` in `winston < 3.0.0`.
*/
module.exports = opts => new CliFormat(opts);
//
// Attach the CliFormat for registration purposes
//
module.exports.Format = CliFormat;