-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4575 from nextcloud/backport/4574/stable-20.1
[stable-20.1] Convert log class to kotlin
- Loading branch information
Showing
2 changed files
with
58 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Nextcloud Talk - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2024 Daniel Calviño Sánchez <[email protected]> | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
*/ | ||
package android.util | ||
|
||
/** | ||
* Dummy implementation of android.util.Log to be used in unit tests. | ||
* | ||
* | ||
* The Android Gradle plugin provides a library with the APIs of the Android framework that throws an exception if any | ||
* of them are called. This class is loaded before that library and therefore becomes the implementation used during the | ||
* tests, simply printing the messages to the system console. | ||
*/ | ||
object Log { | ||
|
||
@JvmStatic | ||
fun d(tag: String, msg: String): Int { | ||
println("DEBUG: $tag: $msg") | ||
|
||
return 1 | ||
} | ||
|
||
@JvmStatic | ||
fun e(tag: String, msg: String): Int { | ||
println("ERROR: $tag: $msg") | ||
|
||
return 1 | ||
} | ||
|
||
@JvmStatic | ||
fun i(tag: String, msg: String): Int { | ||
println("INFO: $tag: $msg") | ||
|
||
return 1 | ||
} | ||
|
||
@JvmStatic | ||
fun isLoggable(tag: String?, level: Int): Boolean { | ||
return true | ||
} | ||
|
||
@JvmStatic | ||
fun v(tag: String, msg: String): Int { | ||
println("VERBOSE: $tag: $msg") | ||
|
||
return 1 | ||
} | ||
|
||
@JvmStatic | ||
fun w(tag: String, msg: String): Int { | ||
println("WARN: $tag: $msg") | ||
|
||
return 1 | ||
} | ||
} |