New: Allow developers to enable Rust logs.
Rather than constantly uncommenting this line locally and rebuilding the SDK, allow a wallet to just turn logging on since it still takes a lot of hoops to even get a log to show up (a dev must add the log dependency to librustzcash, clone all the repos and add logs).
This commit is contained in:
parent
92c951769d
commit
405a047717
|
@ -233,11 +233,22 @@ class RustBackend private constructor() : RustBackendWelding {
|
|||
if (!loaded) {
|
||||
twig("Loading RustBackend") {
|
||||
loadRustLibrary()
|
||||
// initLogs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Forwards Rust logs to logcat. This is a function that is intended for debug purposes. All
|
||||
* logs will be tagged with `cash.z.rust.logs`. Typically, a developer would clone
|
||||
* librustzcash locally and then modify Cargo.toml in this project to point to their local
|
||||
* build (see Cargo.toml for details). From there, they can add any log messages they want
|
||||
* and have them surfaced into the Android logging system. By default, this behavior is
|
||||
* disabled and this is the function that enables it. Initially only the logs in
|
||||
* [src/main/rust/lib.rs] will appear and any additional logs would need to be added by the
|
||||
* developer.
|
||||
*/
|
||||
fun enableRustLogs() = initLogs()
|
||||
|
||||
/**
|
||||
* The first call made to this object in order to load the Rust backend library. All other
|
||||
* external function calls will fail if the libraries have not been loaded.
|
||||
|
|
Loading…
Reference in New Issue