Skip to main content

# logger()

    function logger(options: LoggerOptions): Logger;

create logger

## Parameters​

### options​

`LoggerOptions`

LoggerOptions

## Returns​

`Logger`

instance of logger

## Example​

    // assuming pui-diagnostics javascript is added already to your HTML document
    const { logger, http, logUnhandledErrors, webvitals } = window.emuiDiagnostics || {};
    if (logger) {
      const appLogger = logger({
        transport: http('https://int.api.ellielabs.com/diagnostics/v2/logging'),
        index: 'myapp',
        team: 'my team',
        appName: 'Hello World App',
      });

      webvitals(appLogger);
      logUnhandledErrors(appLogger);
      appLogger.info('application launched');
    } else console.warn('ui logger missing');