Skip to content

@nextrush/logUniversal Logger

One API for Node, edge, serverless, browsers, and React โ€” with global singleton config, structured output, and safe redaction.

Quick Example โ€‹

typescript
import { createLogger } from '@nextrush/log';

const log = createLogger('MyApp');

log.info('Server started', { port: 3000 });
log.error('Failed to connect', new Error('timeout'));

Development โ€” pretty, colorful:

10:30:00 INFO  [MyApp] Server started { port: 3000 }
10:30:01 ERROR [MyApp] Failed to connect Error: timeout

Production โ€” JSON for aggregators:

json
{"timestamp":"...","level":"info","message":"Server started","data":{"port":3000}}

MIT License ยท zero runtime dependencies