Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log loaned msg error only once #44

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions r2r/src/publishers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::ffi::CString;
use std::fmt::Debug;
use std::marker::PhantomData;
use std::sync::Weak;
use std::sync::Once;

use crate::error::*;
use crate::msg_types::*;
Expand Down Expand Up @@ -206,10 +207,12 @@ where
);
Ok(msg)
} else {
// TODO: Switch to logging library
eprintln!(
"Currently used middleware can't loan messages. Local allocator will be used."
);
static LOG_LOANED_ERROR: Once = Once::new();
LOG_LOANED_ERROR.call_once(|| {
// TODO: Switch to logging library
eprintln!("Currently used middleware can't loan messages. Local allocator will be used.");
});

Ok(WrappedNativeMsg::<T>::new())
}
}
Expand Down