## @node-ts/bus-core/logger

Logging is fully configurable and by default uses [debug](https://www.npmjs.com/package/debug).

## Controlling the log level of the default logger

By default all log levels are invoked when running. It is up to the logger to determine what to output depending on the log level.

For the default logger (ie: [debug](https://www.npmjs.com/package/debug)), this can be controlled by setting the value of `DEBUG`.

For example, to get the full debug output of Bus:

```sh
DEBUG=@node-ts/bus-* npm run index.js
```

## Providing a new logger

A third party or custom logger can be provided by using the `.withLogger()` function when configuring the bus.

For example:

```typescript
import { Bus, Logger } from '@node-ts/bus-core'

const consoleLogger: Logger = {
  debug: console.log,
  trace: console.log
  info: console.log
  warn: console.log
  error: console.log
  fatal: console.log
}

Bus.configure()
  .withLogger((target: string) => consoleLogger)
```
