How to use the @expo/bunyan.ERROR function in @expo/bunyan

To help you get started, we’ve selected a few @expo/bunyan 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 NervJS / taro / packages / taro-rn-runner / src / util / packager.js View on Github external
`Running app on ${chunk.deviceName} in ${devEnabled ? 'development' : 'production'} mode\n`
      )
      return
    }

    if (chunk.msg === 'Dependency graph loaded.') {
      packagerReady = true
      onReady()
      return
    }

    if (packagerReady) {
      const message = `${chunk.msg.trim()}\n`
      logWithLevel(chunk)

      if (chunk.level === bunyan.ERROR) {
        // if you run into a syntax error then we should clear log output on reload
        needsClear = message.indexOf('SyntaxError') >= 0
      }
    } else {
      if (chunk.level >= bunyan.ERROR) {
        log(chalk.yellow('***ERROR STARTING PACKAGER***'))
        log(logBuffer)
        log(chalk.red(chunk.msg))
        logBuffer = ''
      } else {
        logBuffer += chunk.msg + '\n'
      }
    }
  }
github expo / expo-cli / dev / xdl / src / Logger.js View on Github external
write(rec) {
    if (rec.level < bunyan.INFO) {
      console.log(rec);
    } else if (rec.level < bunyan.WARN) {
      console.info(rec);
    } else if (rec.level < bunyan.ERROR) {
      console.warn(rec);
    } else {
      console.error(rec);
    }
  }
}
github expo / expo-cli / packages / xdl / src / Logger.ts View on Github external
write(record: any) {
    if (record.level < bunyan.INFO) {
      console.log(record);
    } else if (record.level < bunyan.WARN) {
      console.info(record);
    } else if (record.level < bunyan.ERROR) {
      console.warn(record);
    } else {
      console.error(record);
    }
  }
}
github expo / exp / src / exp.js View on Github external
case NotificationCode.START_LOADING:
              simpleSpinner.start();
              return;
            case NotificationCode.STOP_LOADING:
              simpleSpinner.stop();
              return;
            case NotificationCode.DOWNLOAD_CLI_PROGRESS:
              return;
          }
        }

        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);
        }
      },
    },
github expo / exp / src / exp.js View on Github external
case NotificationCode.START_LOADING:
              simpleSpinner.start();
              return;
            case NotificationCode.STOP_LOADING:
              simpleSpinner.stop();
              return;
            case NotificationCode.DOWNLOAD_CLI_PROGRESS:
              return;
          }
        }

        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);
        }
      },
    },
github expo / xde / src / ui / NotificationsTab.js View on Github external
render() {
    let { notifications } = this.props;

    let logs = [];

    if (notifications) {
      this._addLogsForArray(
        logs,
        notifications.error,
        bunyan.ERROR,
        'Error',
        StyleConstants.colorError
      );
      this._addLogsForArray(
        logs,
        notifications.warn,
        bunyan.WARN,
        'Warning',
        StyleConstants.colorWarning
      );
      this._addLogsForArray(logs, notifications.info, bunyan.INFO, 'Info');
    }

    if (logs.length === 0) {
      logs.push({
        level: bunyan.INFO,
github expo / expo-cli / packages / xdl / src / Logger.ts View on Github external
},
        ]
      : [],
});

export type LogStream = bunyan.Stream;
export type Log = bunyan;

export default {
  child: (options: object) => logger.child(options),
  notifications: logger.child({ type: 'notifications' }),
  global: logger.child({ type: 'global' }),
  DEBUG: bunyan.DEBUG,
  INFO: bunyan.INFO,
  WARN: bunyan.WARN,
  ERROR: bunyan.ERROR,
};
github expo / expo-cli / packages / expo-cli / src / exp.ts View on Github external
case NotificationCode.START_LOADING:
              simpleSpinner.start();
              return;
            case NotificationCode.STOP_LOADING:
              simpleSpinner.stop();
              return;
            case NotificationCode.DOWNLOAD_CLI_PROGRESS:
              return;
          }
        }

        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);
        }
      },
    },
github react-community / create-react-native-app / react-native-scripts / src / util / packager.js View on Github external
const logWithLevel = chunk => {
  if (!chunk.msg) {
    return;
  }

  let colorFn = str => str;
  if (chunk.level === bunyan.WARN) {
    colorFn = chalk.yellow;
  } else if (chunk.level === bunyan.ERROR) {
    colorFn = chalk.red;
  }

  if (chunk.includesStack) {
    logStackTrace(chunk, log.withTimestamp, log, colorFn);
  } else {
    logLines(chunk.msg, log.withTimestamp, colorFn);
  }
};
github expo / expo-cli / dev / xdl / src / Logger.js View on Github external
type: 'raw',
            stream: new ConsoleRawStream(),
            closeOnExit: false,
            level: 'debug',
          },
        ]
      : []),
  ],
});

logger.notifications = logger.child({ type: 'notifications' });
logger.global = logger.child({ type: 'global' });
logger.DEBUG = bunyan.DEBUG;
logger.INFO = bunyan.INFO;
logger.WARN = bunyan.WARN;
logger.ERROR = bunyan.ERROR;

export default logger;

@expo/bunyan

a JSON logging library for node.js services

MIT
Latest version published 3 years ago

Package Health Score

61 / 100
Full package analysis