android write rust log to ExternalStorage/RustDesk/Logs

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-10-17 18:49:34 +08:00
parent 63591941b8
commit 2e829956f4
2 changed files with 20 additions and 4 deletions

View File

@@ -39,11 +39,15 @@ fn initialize(app_dir: &str) {
*config::APP_DIR.write().unwrap() = app_dir.to_owned();
#[cfg(target_os = "android")]
{
// flexi_logger can't work when android_logger initialized.
#[cfg(debug_assertions)]
android_logger::init_once(
android_logger::Config::default()
.with_max_level(log::LevelFilter::Debug) // limit log level
.with_tag("ffi"), // logs will show under mytag tag
);
#[cfg(not(debug_assertions))]
hbb_common::init_log(false, "");
#[cfg(feature = "mediacodec")]
scrap::mediacodec::check_mediacodec();
crate::common::test_rendezvous_server();
@@ -359,13 +363,18 @@ pub fn session_get_use_all_my_displays_for_the_remote_session(
session_id: SessionID,
) -> SyncReturn<Option<String>> {
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
SyncReturn(Some(session.get_use_all_my_displays_for_the_remote_session()))
SyncReturn(Some(
session.get_use_all_my_displays_for_the_remote_session(),
))
} else {
SyncReturn(None)
}
}
pub fn session_set_use_all_my_displays_for_the_remote_session(session_id: SessionID, value: String) {
pub fn session_set_use_all_my_displays_for_the_remote_session(
session_id: SessionID,
value: String,
) {
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
session.save_use_all_my_displays_for_the_remote_session(value);
}