diff --git a/src/plugin/callback_msg.rs b/src/plugin/callback_msg.rs index 554ab595a..7c0109688 100644 --- a/src/plugin/callback_msg.rs +++ b/src/plugin/callback_msg.rs @@ -61,7 +61,7 @@ struct MsgToConfig { /// content: The content. /// len: The length of the content. #[no_mangle] -pub extern "C" fn cb_msg( +pub(super) extern "C" fn cb_msg( peer: *const c_char, target: *const c_char, id: *const c_char, diff --git a/src/plugin/plog.rs b/src/plugin/plog.rs index 9ef215d74..f1e78d36e 100644 --- a/src/plugin/plog.rs +++ b/src/plugin/plog.rs @@ -13,7 +13,7 @@ fn is_level(level: *const c_char, level_bytes: &[u8]) -> bool { } #[no_mangle] -pub(super) extern "C" fn log(level: *const c_char, msg: *const c_char) { +pub(super) extern "C" fn plugin_log(level: *const c_char, msg: *const c_char) { if level.is_null() || msg.is_null() { return; } diff --git a/src/plugin/plugins.rs b/src/plugin/plugins.rs index e2eae87cf..4fb69a943 100644 --- a/src/plugin/plugins.rs +++ b/src/plugin/plugins.rs @@ -302,7 +302,7 @@ fn load_plugin_path(path: &str) -> ResultType<()> { msg: callback_msg::cb_msg, get_conf: config::cb_get_conf, get_id: config::cb_get_local_peer_id, - log: super::plog::log, + log: super::plog::plugin_log, }, }; plugin.init(&init_data, path)?; @@ -409,6 +409,12 @@ pub fn handle_client_event(id: &str, peer: &str, event: &[u8]) -> Option ERR_RUSTDESK_HANDLE_BASE && code < ERR_PLUGIN_HANDLE_BASE { + log::debug!( + "Plugin {} failed to handle client event, code: {}, msg: {}", + id, + code, + msg + ); let name = match PLUGIN_INFO.read().unwrap().get(id) { Some(plugin) => plugin.desc.name(), None => "???", @@ -429,7 +435,8 @@ pub fn handle_client_event(id: &str, peer: &str, event: &[u8]) -> Option