Skip to content

Commit 69e5584

Browse files
committed
improve logs
1 parent c7799a6 commit 69e5584

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

crates/bevy_mod_scripting_core/src/commands.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ impl<P: IntoScriptPluginParams> Command for CreateOrUpdateScript<P> {
217217
bevy::log::debug!("{}: reloading script with id: {}", P::LANGUAGE, self.id);
218218
self.reload_context(guard.clone(), handler_ctxt)
219219
}
220-
None => self.load_context(guard.clone(), handler_ctxt),
220+
None => {
221+
bevy::log::debug!("{}: loading script with id: {}", P::LANGUAGE, self.id);
222+
self.load_context(guard.clone(), handler_ctxt)
223+
}
221224
};
222225

223226
let result = result.and_then(|()| {
@@ -231,7 +234,13 @@ impl<P: IntoScriptPluginParams> Command for CreateOrUpdateScript<P> {
231234
});
232235

233236
match result {
234-
Ok(_) => {}
237+
Ok(_) => {
238+
bevy::log::debug!(
239+
"{}: script with id: {} successfully created or updated",
240+
P::LANGUAGE,
241+
self.id
242+
);
243+
}
235244
Err(e) => {
236245
let phrase = if assigned_shared_context.is_some() {
237246
"reloading"

crates/bevy_mod_scripting_core/src/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub(crate) fn event_handler_inner<P: IntoScriptPluginParams>(
206206
match e.downcast_interop_inner() {
207207
Some(InteropErrorInner::MissingScript { script_id }) => {
208208
trace_once!(
209-
"{}: Script `{}` on entity `{:?}` is either still loading or doesn't exist, ignoring until the corresponding script is loaded.",
209+
"{}: Script `{}` on entity `{:?}` is either still loading, doesn't exist, or is for another language, ignoring until the corresponding script is loaded.",
210210
P::LANGUAGE,
211211
script_id, entity
212212
);

0 commit comments

Comments
 (0)