Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gallolabs/logger

Simple and powerfull javascript logger
https://github.com/gallolabs/logger

logger

Last synced: 29 days ago
JSON representation

Simple and powerfull javascript logger

Awesome Lists containing this project

README

        



Gallo logger

Simple logger:
- [x] log -> processors -> obfuscation -> handlers (own processors + format + transport)
- [x] Advanced childs (not only id and metadata but also own processors and handlers stack), siblings, and extends
- [x] Default simple JSON console logging
- [x] logfmt formatter available
- [x] BreadCrumb handler (like Monolog Fingers crossed handler) : keep some verbose logs in memory until an error-like log is logged. Kept verbose logs are flushed with it. Verbose logs are kept on a logger chain (parent/child) to flush only (as possible) relevant logs.
- [x] Error handler
- [x] Idle wait method
- [ ] Move filter (level) logic to logger ? Create intermediate handler ? Create a mapping filter<->handler with potentially advanced filters (on metadata etc) ?
- [ ] Reduce complexity as remote-ee with only 1 root instance and others child instances, and change onError by events ?

```typescript

const logger = createLogger({...})

// loggerId can be any type
const child = logger.child({ component: 'http-server', alias: 'public-server' })
const child = logger.child('public-server', {child: true})

child.info('My log', {password: 'secret'})

// Will log {level: 'info', message: 'My log', password: '***', child: true, timestamp: '(date)', logger: 'public-server'}

```