How to use the @firebase/logger.LogLevel.ERROR function in @firebase/logger

To help you get started, we’ve selected a few @firebase/logger 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 firebase / firebase-js-sdk / packages / remote-config / index.ts View on Github external
if (!apiKey) {
      throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_API_KEY);
    }
    if (!appId) {
      throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_APP_ID);
    }
    namespace = namespace || 'firebase';

    const storage = new Storage(appId, app.name, namespace);
    const storageCache = new StorageCache(storage);

    const logger = new Logger(packageName);

    // Sets ERROR as the default log level.
    // See RemoteConfig#setLogLevel for corresponding normalization to ERROR log level.
    logger.logLevel = FirebaseLogLevel.ERROR;

    const restClient = new RestClient(
      installations,
      // Uses the JS SDK version, by which the RC package version can be deduced, if necessary.
      firebaseInstance.SDK_VERSION,
      namespace,
      projectId,
      apiKey,
      appId
    );
    const retryingClient = new RetryingClient(restClient, storage);
    const cachingClient = new CachingClient(
      retryingClient,
      storage,
      storageCache,
      logger
github firebase / firebase-js-sdk / packages / remote-config / src / remote_config.ts View on Github external
setLogLevel(logLevel: RemoteConfigLogLevel): void {
    switch (logLevel) {
      case 'debug':
        this._logger.logLevel = FirebaseLogLevel.DEBUG;
        break;
      case 'silent':
        this._logger.logLevel = FirebaseLogLevel.SILENT;
        break;
      default:
        this._logger.logLevel = FirebaseLogLevel.ERROR;
    }
  }
github maierj / fastlane-action / node_modules / @firebase / remote-config / dist / index.esm2017.js View on Github external
setLogLevel(logLevel) {
        switch (logLevel) {
            case 'debug':
                this._logger.logLevel = LogLevel.DEBUG;
                break;
            case 'silent':
                this._logger.logLevel = LogLevel.SILENT;
                break;
            default:
                this._logger.logLevel = LogLevel.ERROR;
        }
    }
    get fetchTimeMillis() {
github maierj / fastlane-action / node_modules / @firebase / remote-config / dist / index.esm.js View on Github external
RemoteConfig.prototype.setLogLevel = function (logLevel) {
        switch (logLevel) {
            case 'debug':
                this._logger.logLevel = LogLevel.DEBUG;
                break;
            case 'silent':
                this._logger.logLevel = LogLevel.SILENT;
                break;
            default:
                this._logger.logLevel = LogLevel.ERROR;
        }
    };
    Object.defineProperty(RemoteConfig.prototype, "fetchTimeMillis", {
github firebase / firebase-js-sdk / packages / firestore / src / util / log.ts View on Github external
export function setLogLevel(newLevel: LogLevel): void {
  /**
   * Map the new log level to the associated Firebase Log Level
   */
  switch (newLevel) {
    case LogLevel.DEBUG:
      logClient.logLevel = FirebaseLogLevel.DEBUG;
      break;
    case LogLevel.ERROR:
      logClient.logLevel = FirebaseLogLevel.ERROR;
      break;
    case LogLevel.SILENT:
      logClient.logLevel = FirebaseLogLevel.SILENT;
      break;
    default:
      logClient.error(
        `Firestore (${SDK_VERSION}): Invalid value passed to \`setLogLevel\``
      );
  }
}
github firebase / firebase-js-sdk / packages / firestore / src / util / log.ts View on Github external
export function error(msg: string, ...obj: unknown[]): void {
  if (logClient.logLevel <= FirebaseLogLevel.ERROR) {
    const args = obj.map(argToString);
    logClient.error(`Firestore (${SDK_VERSION}): ${msg}`, ...args);
  }
}

@firebase/logger

A logger package for use in the Firebase JS SDK

Apache-2.0
Latest version published 14 days ago

Package Health Score

95 / 100
Full package analysis

Similar packages