> For the complete documentation index, see [llms.txt](https://dormakaba-digital.gitbook.io/reactnative-client/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dormakaba-digital.gitbook.io/reactnative-client/utils/logger.md).

# Logger

Basic logger. A logger that lets you extend implementations as needed. Eg. for using an external logging service.

```javascript
import { Logger } from '@dormakaba/digital-reactnative-client';

// functions like used in console.log
Logger.log('msg', arg1, arg2, ...);
Logger.warn('msg', arg1, arg2, ...);
Logger.error('msg', arg1, arg2, ...);
Logger.critical('msg', arg1, arg2, ...);

// override the logger implementation
const myLogger = {
  type: 'logger',
  log(args) { this._output('log', args); },
  warn(args) { this._output('warn', args); },
  error(args) { this._output('error', args); },
  _output(type, args) { if (console && console[type]) console[type](...Array.prototype.slice.call(args)); },
};

Logger.init(myLogger)
```
