com.google.firebase.database.Logger Java Examples
The following examples show how to use
com.google.firebase.database.Logger.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GeoFireTestingRule.java From geofire-android with Apache License 2.0 | 6 votes |
public void before(Context context) throws Exception { if (FirebaseApp.getApps(context).isEmpty()) { FirebaseOptions firebaseOptions = new FirebaseOptions.Builder() .setApplicationId("1:1010498001935:android:f17a2f247ad8e8bc") .setApiKey("AIzaSyBys-YxxE7kON5PxZc5aY6JwVvreyx_owc") .setDatabaseUrl(databaseUrl) .build(); FirebaseApp.initializeApp(context, firebaseOptions); FirebaseDatabase.getInstance().setLogLevel(Logger.Level.DEBUG); } if (FirebaseAuth.getInstance().getCurrentUser() == null) { Task<AuthResult> signInTask = TaskUtils.waitForTask(FirebaseAuth.getInstance().signInAnonymously()); if (signInTask.isSuccessful()) { Log.d(TAG, "Signed in as " + signInTask.getResult().getUser()); } else { throw new Exception("Failed to sign in: " + signInTask.getException()); } } this.databaseReference = FirebaseDatabase.getInstance().getReferenceFromUrl(databaseUrl); }
Example #2
Source File: DatabaseConfig.java From firebase-android-sdk with Apache License 2.0 | 6 votes |
/** * 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); } }
Example #3
Source File: FirebaseDataManager.java From Android-MVP-vs-MVVM-Samples with Apache License 2.0 | 3 votes |
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); }
Example #4
Source File: DatabaseConfig.java From firebase-android-sdk with Apache License 2.0 | 2 votes |
/** * 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; }
Example #5
Source File: DatabaseConfig.java From firebase-android-sdk with Apache License 2.0 | 2 votes |
/** * 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; }