Phase 1-14 complete: - Unified Express.js API (TypeScript, Prisma ORM, PostgreSQL 16) - React Admin GUI (Vite + Ant Design + Zustand) - JWT auth with refresh tokens - Influence: Campaigns, Representatives, Responses, Email Queue - Map: Locations, Cuts, Shifts, Canvassing System - NAR data import infrastructure (2025 format) - Listmonk newsletter integration - Landing page builder (GrapesJS) - MkDocs + Code Server integration - Volunteer portal with GPS tracking - Monitoring stack (Prometheus, Grafana, Alertmanager) - Pangolin tunnel integration Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
21 lines
732 B
TypeScript
21 lines
732 B
TypeScript
import winston from 'winston';
|
|
import { env } from '../config/env';
|
|
|
|
export const logger = winston.createLogger({
|
|
level: env.NODE_ENV === 'production' ? 'info' : 'debug',
|
|
format: winston.format.combine(
|
|
winston.format.timestamp(),
|
|
winston.format.errors({ stack: true }),
|
|
env.NODE_ENV === 'production'
|
|
? winston.format.json()
|
|
: winston.format.combine(
|
|
winston.format.colorize(),
|
|
winston.format.printf(({ timestamp, level, message, ...meta }) => {
|
|
const metaStr = Object.keys(meta).length ? ` ${JSON.stringify(meta)}` : '';
|
|
return `${timestamp} [${level}]: ${message}${metaStr}`;
|
|
})
|
|
)
|
|
),
|
|
transports: [new winston.transports.Console()],
|
|
});
|