Easy setup logging on FFI libs for mobile devices
camarim: (pt-br) Backstage room on the theater where actors get ready to show up on stage
This crate let you easilly get logging available for FFI libraries, specially when targeting Android and iOS devices.
You can use the library as an optional dependency, to use only during debug.
On Cargo.toml
add:
```toml [dependencies.camarim] version = '0.1.0' optional = true
[features] logs = ['camarim'] ```
```rust
camarim::install!(); ```
sh
cross build --features logs --target x86_64-linux-android
On the FFI side, use the camarim_setup_logger
function to setup the logging.
For example, in Dart
:
```dart import 'dart:ffi' as ffi;
final ffi.DynamicLibrary _myLib = Platform.isAndroid ? ffi.DynamicLibrary.open("libmylib.so") : ffi.DynamicLibrary.process();
/// Find camarim_setup_logger
to call it during your app startup
final startLogger =
sledNative.lookupFunction
/// ... declare the your crate exposed functions ```