Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ReactNative = require('react-native');
const { AppCenterReactNative } = ReactNative.NativeModules;
const AppCenterLog = require('appcenter/appcenter-log');
const PackageJson = require('./package.json');
const logTag = 'AppCenter';
const AppCenter = {
LogLevel: {
VERBOSE: AppCenterLog.LogLevelVerbose, // Logging will be very chatty
DEBUG: AppCenterLog.LogLevelDebug, // Debug information will be logged
INFO: AppCenterLog.LogLevelInfo, // Information will be logged
WARNING: AppCenterLog.LogLevelWarning, // Errors and warnings will be logged
ERROR: AppCenterLog.LogLevelError, // Errors will be logged
ASSERT: AppCenterLog.LogLevelAssert, // Only critical errors will be logged
NONE: AppCenterLog.LogLevelNone // Logging is disabled
},
/**
* @deprecated Use `LogLevel.VERBOSE` instead.
*/
LogLevelVerbose: AppCenterLog.LogLevelVerbose,
/**
* @deprecated Use `LogLevel.DEBUG` instead.
*/
LogLevelDebug: AppCenterLog.LogLevelDebug,
/**
* @deprecated Use `LogLevel.INFO` instead.
*/
LogLevelInfo: AppCenterLog.LogLevelInfo,
/**
* @deprecated Use `LogLevel.WARNING` instead.
*/
LogLevelWarning: AppCenterLog.LogLevelWarning,
/**
* @deprecated Use `LogLevel.ERROR` instead.
*/
LogLevelError: AppCenterLog.LogLevelError,
/**
* @deprecated Use `LogLevel.ASSERT` instead.
*/
LogLevelAssert: AppCenterLog.LogLevelAssert,
/**
* @deprecated Use `LogLevel.NONE` instead.
*/
LogLevelNone: AppCenterLog.LogLevelNone,
// async - returns a Promise
startFromLibrary(service) {
return AppCenterReactNative.startFromLibrary(service);
},
// async - returns a Promise
getLogLevel() {
return AppCenterReactNative.getLogLevel();
},