UNPKG

qgenutils

Version:

A security-first Node.js utility library providing authentication, HTTP operations, URL processing, validation, datetime formatting, and template rendering. Designed as a lightweight alternative to heavy npm packages with comprehensive error handling and

38 lines (36 loc) 926 B
/** * Test-friendly logger that avoids Winston transport issues * Used during testing to prevent qerrors dependency problems */ const testLogger = { info: (message, meta = {}) => { if (process.env.NODE_ENV === 'test') { // Silent during tests unless DEBUG=true if (process.env.DEBUG) { console.log('INFO:', message, meta); } } }, error: (message, meta = {}) => { if (process.env.NODE_ENV === 'test') { if (process.env.DEBUG) { console.error('ERROR:', message, meta); } } }, warn: (message, meta = {}) => { if (process.env.NODE_ENV === 'test') { if (process.env.DEBUG) { console.warn('WARN:', message, meta); } } }, debug: (message, meta = {}) => { if (process.env.NODE_ENV === 'test') { if (process.env.DEBUG) { console.log('DEBUG:', message, meta); } } } }; module.exports = testLogger;