Merge pull request #6076 from 21pages/android_log_ext
android write rust log to ExternalStorage/RustDesk/Logs
This commit is contained in:
commit
74ecea6307
@ -341,8 +341,8 @@ impl Default for PeerConfig {
|
|||||||
view_only: Default::default(),
|
view_only: Default::default(),
|
||||||
reverse_mouse_wheel: Self::default_reverse_mouse_wheel(),
|
reverse_mouse_wheel: Self::default_reverse_mouse_wheel(),
|
||||||
displays_as_individual_windows: Self::default_displays_as_individual_windows(),
|
displays_as_individual_windows: Self::default_displays_as_individual_windows(),
|
||||||
use_all_my_displays_for_the_remote_session: Self::default_use_all_my_displays_for_the_remote_session(
|
use_all_my_displays_for_the_remote_session:
|
||||||
),
|
Self::default_use_all_my_displays_for_the_remote_session(),
|
||||||
custom_resolutions: Default::default(),
|
custom_resolutions: Default::default(),
|
||||||
options: Self::default_options(),
|
options: Self::default_options(),
|
||||||
ui_flutter: Default::default(),
|
ui_flutter: Default::default(),
|
||||||
@ -623,6 +623,13 @@ impl Config {
|
|||||||
std::fs::create_dir_all(&path).ok();
|
std::fs::create_dir_all(&path).ok();
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
{
|
||||||
|
let mut path = Self::get_home();
|
||||||
|
path.push(format!("{}/Logs", *APP_NAME.read().unwrap()));
|
||||||
|
std::fs::create_dir_all(&path).ok();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
if let Some(path) = Self::path("").parent() {
|
if let Some(path) = Self::path("").parent() {
|
||||||
let mut path: PathBuf = path.into();
|
let mut path: PathBuf = path.into();
|
||||||
path.push("log");
|
path.push("log");
|
||||||
|
@ -39,11 +39,15 @@ fn initialize(app_dir: &str) {
|
|||||||
*config::APP_DIR.write().unwrap() = app_dir.to_owned();
|
*config::APP_DIR.write().unwrap() = app_dir.to_owned();
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
{
|
{
|
||||||
|
// flexi_logger can't work when android_logger initialized.
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
android_logger::init_once(
|
android_logger::init_once(
|
||||||
android_logger::Config::default()
|
android_logger::Config::default()
|
||||||
.with_max_level(log::LevelFilter::Debug) // limit log level
|
.with_max_level(log::LevelFilter::Debug) // limit log level
|
||||||
.with_tag("ffi"), // logs will show under mytag tag
|
.with_tag("ffi"), // logs will show under mytag tag
|
||||||
);
|
);
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
hbb_common::init_log(false, "");
|
||||||
#[cfg(feature = "mediacodec")]
|
#[cfg(feature = "mediacodec")]
|
||||||
scrap::mediacodec::check_mediacodec();
|
scrap::mediacodec::check_mediacodec();
|
||||||
crate::common::test_rendezvous_server();
|
crate::common::test_rendezvous_server();
|
||||||
@ -359,13 +363,18 @@ pub fn session_get_use_all_my_displays_for_the_remote_session(
|
|||||||
session_id: SessionID,
|
session_id: SessionID,
|
||||||
) -> SyncReturn<Option<String>> {
|
) -> SyncReturn<Option<String>> {
|
||||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
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 {
|
} else {
|
||||||
SyncReturn(None)
|
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) {
|
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||||
session.save_use_all_my_displays_for_the_remote_session(value);
|
session.save_use_all_my_displays_for_the_remote_session(value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user