Skip to content

Commit

Permalink
fix: only use tracing_android in android
Browse files Browse the repository at this point in the history
  • Loading branch information
hpp2334 committed Mar 8, 2024
1 parent bec28d3 commit 13db0c2
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions rust-libs/ease-client/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn create_log(dir: &str) -> std::fs::File {
file
}

#[cfg(not(target_os = "windows"))]
#[cfg(target_os = "android")]
fn setup_subscriber(dir: &str) {
use tracing_subscriber::layer::SubscriberExt;
let log_file = create_log(dir);
Expand All @@ -170,7 +170,7 @@ fn setup_subscriber(dir: &str) {
set_global_default(subscriber).unwrap();
}

#[cfg(target_os = "windows")]
#[cfg(not(target_os = "android"))]
fn setup_subscriber(dir: &str) {
let log_file = create_log(dir);
let subscriber = tracing_subscriber::FmtSubscriber::builder()
Expand Down Expand Up @@ -273,17 +273,26 @@ pub fn seek_music(arg: ArgSeekMusic) -> ApiRet {
}

pub fn set_current_music_position_for_player_internal(arg: u64) -> ApiRet {
let ret = call_controller(controller_set_current_music_position_for_player_internal, arg)?;
let ret = call_controller(
controller_set_current_music_position_for_player_internal,
arg,
)?;
Ok(SyncReturn(ret))
}

pub fn update_current_music_total_duration_for_player_internal(arg: u64) -> ApiRet {
let ret = call_controller(controller_update_current_music_total_duration_for_player_internal, arg)?;
let ret = call_controller(
controller_update_current_music_total_duration_for_player_internal,
arg,
)?;
Ok(SyncReturn(ret))
}

pub fn update_current_music_playing_for_player_internal(arg: bool) -> ApiRet {
let ret = call_controller(controller_update_current_music_playing_for_player_internal, arg)?;
let ret = call_controller(
controller_update_current_music_playing_for_player_internal,
arg,
)?;
Ok(SyncReturn(ret))
}

Expand Down Expand Up @@ -486,4 +495,3 @@ pub fn test_connection(arg: ArgUpsertStorage) -> ApiRet {
let ret = call_controller(controller_test_connection, arg)?;
Ok(SyncReturn(ret))
}

0 comments on commit 13db0c2

Please sign in to comment.