Skip to content

Commit b909cf8

Browse files
committed
docs: fix proc-log event-name
1 parent 016f14d commit b909cf8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ Log.handleExitEvents('process-exit')
539539

540540
## Emit Log events with ProcLog
541541

542-
Decouple logging via process event 'log'. This allows to use a different
542+
Decouple logging via process event 'log-level'. This allows to use a different
543543
logger framework than 'debug-level'. In such cases you'd need to adapt your
544544
framework of choice for logging. Check `initProcLog()` for inspiration.
545545

@@ -565,11 +565,13 @@ import { ProcLog, initProcLog } from 'debug-level'
565565
// If using a different logger you'd need to provide a custom initializer which
566566
// connects to the framework of choice.
567567
initProcLog({ serializers: {...}, Log: LogEcs })
568+
// or default
569+
initProcLog()
568570

569571
// Add a logger with a namespace.
570572
// Use options only for defining the log-level (or leave undefined to control
571573
// via env-vars)
572-
const log = new ProcLog('app:namespace')
574+
const log = new ProcLog('my-webapp:namespace')
573575
// add some logging
574576
log.info('show some logging')
575577
```
@@ -640,9 +642,9 @@ In your single page application use:
640642
import { Log } from 'debug-level'
641643

642644
localStorage.setItem('DEBUG_URL', '/debug-level')
643-
localStorage.setItem('DEBUG', 'myApp*')
645+
localStorage.setItem('DEBUG', 'my-app*')
644646
// ...
645-
const log = new Log('myApp')
647+
const log = new Log('my-app')
646648

647649
log.debug('my first %s', 'logline')
648650
```

0 commit comments

Comments
 (0)