Java 类com.google.firebase.database.Logger 实例源码

项目:firebase-admin-java    文件:DatabaseConfig.java   
/**
 * By default, this is set to {@link Logger.Level#INFO INFO}. This includes any internal errors
 * ({@link Logger.Level#ERROR ERROR}) and any security debug messages ({@link Logger.Level#INFO
 * INFO}) that the client receives. Set to {@link Logger.Level#DEBUG DEBUG} to turn on the
 * diagnostic logging, and {@link Logger.Level#NONE NONE} to disable all logging.
 *
 * @param logLevel The desired minimum log level
 */
public synchronized void setLogLevel(Logger.Level logLevel) {
  assertUnfrozen();
  switch (logLevel) {
    case DEBUG:
      this.logLevel = com.google.firebase.database.logging.Logger.Level.DEBUG;
      break;
    case INFO:
      this.logLevel = com.google.firebase.database.logging.Logger.Level.INFO;
      break;
    case WARN:
      this.logLevel = com.google.firebase.database.logging.Logger.Level.WARN;
      break;
    case ERROR:
      this.logLevel = com.google.firebase.database.logging.Logger.Level.ERROR;
      break;
    case NONE:
      this.logLevel = com.google.firebase.database.logging.Logger.Level.NONE;
      break;
    default:
      throw new IllegalArgumentException("Unknown log level: " + logLevel);
  }
}
项目:Raffler-Android    文件:AppApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    Realm.init(this);
    RealmConfiguration config = new RealmConfiguration.Builder()
            .deleteRealmIfMigrationNeeded()
            //.schemaVersion(2) // Must be bumped when the schema changes
            //.migration(new RealmContactMigration()) // Migration to run instead of throwing an exception
            .name("default.realm").build();
    Realm.setDefaultConfiguration(config);

    if(database==null) {
        FirebaseDatabase.getInstance().setPersistenceEnabled(true);
        FirebaseDatabase.getInstance().setLogLevel(Logger.Level.DEBUG);
    }

    database = FirebaseDatabase.getInstance();
    References.init(this, database);

    AppManager.getInstance().setContext(getApplicationContext());
    AppManager.getInstance().setCountry(Country.getCountryFromSIM(getApplicationContext()));

    // Initialize image loader
    initImageLoader(this);
}
项目:gdx-firebase    文件:AndroidFirebaseDatabase.java   
@Override
public synchronized void setLogLevel(LogLevel logLevel) {
    if (logLevel == LogLevel.DEBUG) {
        com.google.firebase.database.FirebaseDatabase.getInstance().setLogLevel(Logger.Level.DEBUG);
    }
    if (logLevel == LogLevel.ERROR) {
        com.google.firebase.database.FirebaseDatabase.getInstance().setLogLevel(Logger.Level.ERROR);
    }
    if (logLevel == LogLevel.INFO) {
        com.google.firebase.database.FirebaseDatabase.getInstance().setLogLevel(Logger.Level.INFO);
    }
    if (logLevel == LogLevel.NONE) {
        com.google.firebase.database.FirebaseDatabase.getInstance().setLogLevel(Logger.Level.NONE);
    }
    if (logLevel == LogLevel.WARN) {
        com.google.firebase.database.FirebaseDatabase.getInstance().setLogLevel(Logger.Level.WARN);
    }
}
项目:gdx-firebase    文件:DesktopFirebaseDatabase.java   
@Override
public synchronized void setLogLevel(LogLevel logLevel) {
    if (logLevel == LogLevel.DEBUG) {
        com.google.firebase.database.FirebaseDatabase.getInstance(app).setLogLevel(Logger.Level.DEBUG);
    }
    if (logLevel == LogLevel.ERROR) {
        com.google.firebase.database.FirebaseDatabase.getInstance(app).setLogLevel(Logger.Level.ERROR);
    }
    if (logLevel == LogLevel.INFO) {
        com.google.firebase.database.FirebaseDatabase.getInstance(app).setLogLevel(Logger.Level.INFO);
    }
    if (logLevel == LogLevel.NONE) {
        com.google.firebase.database.FirebaseDatabase.getInstance(app).setLogLevel(Logger.Level.NONE);
    }
    if (logLevel == LogLevel.WARN) {
        com.google.firebase.database.FirebaseDatabase.getInstance(app).setLogLevel(Logger.Level.WARN);
    }
}
项目:memory-game    文件:SourceModule.java   
@Provides
@Singleton
public FirebaseDatabase provideFirebaseDatabase() {
    FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
    firebaseDatabase.setPersistenceEnabled(false);
    firebaseDatabase.setLogLevel(BuildConfig.DEBUG ? Logger.Level.DEBUG : Logger.Level.NONE);
    return firebaseDatabase;
}
项目:rx-firebase    文件:RxFirebaseDatabase.java   
@SuppressWarnings("UnusedReturnValue")
public RxFirebaseDatabase setLogLevel(Logger.Level level) {
  query.getRef().getDatabase().setLogLevel(level);
  return this;
}
项目:rx-firebase    文件:RxFirebaseDatabaseTest.java   
@Test
public void shouldSetLogLevel() throws Exception {
  rx.setLogLevel(Logger.Level.DEBUG);

  then(database).should().setLogLevel(Logger.Level.DEBUG);
}
项目:Android-MVP-vs-MVVM-Samples    文件:FirebaseDataManager.java   
public FirebaseDataManager() {
    super();
    final FirebaseDatabase database = FirebaseDatabase.getInstance();
    database.setLogLevel(BuildConfig.DEBUG ? Logger.Level.DEBUG : Logger.Level.NONE);
    database.setPersistenceEnabled(false);

    mDatabase = database.getReference();

    mDatabaseCheckIn = mDatabase.child(TABLE_CHECK_IN);


}
项目:firebase-admin-java    文件:DatabaseConfig.java   
/**
 * If you would like to provide a custom log target, pass an object that implements the {@link
 * com.google.firebase.database.Logger Logger} interface.
 *
 * @hide
 * @param logger The custom logger that will be called with all log messages
 */
public synchronized void setLogger(com.google.firebase.database.logging.Logger logger) {
  assertUnfrozen();
  this.logger = logger;
}
项目:firebase-admin-java    文件:DatabaseConfig.java   
/**
 * Used primarily for debugging. Limits the debug output to the specified components. By default,
 * this is null, which enables logging from all components. Setting this explicitly will also set
 * the log level to {@link Logger.Level#DEBUG DEBUG}.
 *
 * @param debugComponents A list of components for which logs are desired, or null to enable all
 *     components
 */
public synchronized void setDebugLogComponents(List<String> debugComponents) {
  assertUnfrozen();
  setLogLevel(Logger.Level.DEBUG);
  loggedComponents = debugComponents;
}