How to use the xdl.Logger.notifications function in xdl

To help you get started, we’ve selected a few xdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / exp / src / exp.js View on Github external
}
        }

        if (chunk.level === bunyan.INFO) {
          log(chunk.msg);
        } else if (chunk.level === bunyan.WARN) {
          log.warn(chunk.msg);
        } else if (chunk.level >= bunyan.ERROR) {
          log.error(chunk.msg);
        }
      },
    },
    type: 'raw',
  };

  Logger.notifications.addStream(stream);
  Logger.global.addStream(stream);
}
github expo / xde / src / utils / binaries.js View on Github external
{ code: NotificationCode.INSTALL_SHELL_COMMANDS_RESULT },
      `Shell commands ${binaries.join(', ')} are already installed`
    );
    return;
  }

  try {
    await sudoAsync(commands.join('\n'), sudoOptions);
  } catch (e) {
    Logger.notifications.error(
      { code: NotificationCode.INSTALL_SHELL_COMMANDS_RESULT },
      'Error installing shell commands'
    );
    throw e;
  }
  Logger.notifications.info(
    { code: NotificationCode.INSTALL_SHELL_COMMANDS_RESULT },
    `Installed ${installedBinaries.join(', ')} to your shell`
  );
}
github expo / exp / src / exp.js View on Github external
}
        }

        if (chunk.level === bunyan.INFO) {
          log(chunk.msg);
        } else if (chunk.level === bunyan.WARN) {
          log.warn(chunk.msg);
        } else if (chunk.level >= bunyan.ERROR) {
          log.error(chunk.msg);
        }
      },
    },
    type: 'raw',
  };

  Logger.notifications.addStream(stream);
  Logger.global.addStream(stream);
}
github expo / xde / src / ui / MainScreen.js View on Github external
_registerLogs() {
    Logger.notifications.addStream({
      stream: {
        write: chunk => {
          switch (chunk.code) {
            case NotificationCode.OLD_IOS_APP_VERSION:
              this._showNotification(
                'warning',
                'Expo app on iOS simulator is out of date. Click to upgrade.',
                {},
                async () => {
                  await Simulator.upgradeExpoAsync();
                }
              );
              return;
            case NotificationCode.OLD_ANDROID_APP_VERSION:
              this._showNotification(
                'warning',
github expo / xde / src / ui / NewProjectModal.js View on Github external
componentDidMount() {
    Logger.notifications.addStream({
      stream: {
        write: chunk => {
          switch (chunk.code) {
            case NotificationCode.PROGRESS:
              this.setState({
                loadingMessage: chunk.msg,
                notificationType: NotificationCode.PROGRESS,
              });
              break;
            case NotificationCode.DOWNLOAD:
              this.setState({
                loadingMessage: 'Downloading... ' + chunk.msg + '%',
                progress: chunk.msg,
                notificationType: NotificationCode.DOWNLOAD,
              });
              break;
github expo / xde / src / ui / App.js View on Github external
_registerLogs() {
    Logger.notifications.addStream({
      stream: {
        write: (chunk) => {
          switch (chunk.code) {
            case NotificationCode.OLD_IOS_APP_VERSION:
              this._showNotification('warning', 'Exponent app on iOS simulator is out of date. Click to upgrade.', async () => {
                await Simulator.upgradeExponentAsync();
              });
              return;
            case NotificationCode.OLD_ANDROID_APP_VERSION:
              this._showNotification('warning', 'Exponent app on Android device is out of date. Click to upgrade.', async () => {
                await Android.upgradeExponentAsync();
              });
              return;
            case NotificationCode.START_LOADING:
              this.setState({
                isLoading: true,
github expo / xde / src / ui / NewProjectModal.js View on Github external
retryFunction: () =>
            Logger.notifications.info(
              { code: NotificationCode.RETRY_DOWNLOAD },
              MessageCode.DOWNLOAD_IS_SLOW
            ),
        }