aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/java/com/wireguard/android/util/ExceptionLoggers.kt
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/main/java/com/wireguard/android/util/ExceptionLoggers.kt')
-rw-r--r--ui/src/main/java/com/wireguard/android/util/ExceptionLoggers.kt27
1 files changed, 0 insertions, 27 deletions
diff --git a/ui/src/main/java/com/wireguard/android/util/ExceptionLoggers.kt b/ui/src/main/java/com/wireguard/android/util/ExceptionLoggers.kt
deleted file mode 100644
index 4470134c..00000000
--- a/ui/src/main/java/com/wireguard/android/util/ExceptionLoggers.kt
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright © 2017-2019 WireGuard LLC. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0
- */
-package com.wireguard.android.util
-
-import android.util.Log
-import java9.util.function.BiConsumer
-
-/**
- * Helpers for logging exceptions from asynchronous tasks. These can be passed to
- * `CompletionStage.whenComplete()` at the end of an asynchronous future chain.
- */
-enum class ExceptionLoggers(private val priority: Int) : BiConsumer<Any?, Throwable?> {
- D(Log.DEBUG), E(Log.ERROR);
-
- override fun accept(result: Any?, throwable: Throwable?) {
- if (throwable != null)
- Log.println(Log.ERROR, TAG, Log.getStackTraceString(throwable))
- else if (priority <= Log.DEBUG)
- Log.println(priority, TAG, "Future completed successfully")
- }
-
- companion object {
- private const val TAG = "WireGuard/ExceptionLoggers"
- }
-}