de-mut some InvokeContext methods (bp #13301) (#13309)

* de-mut some InvokeContext methods

(cherry picked from commit da9548fd12)

* Simplify CPI interface into MessageProcessor

(cherry picked from commit 9263ae1c60)

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2020-10-30 10:35:59 +00:00
committed by GitHub
parent b859acbfea
commit 4312841433
4 changed files with 32 additions and 28 deletions

View File

@@ -64,14 +64,14 @@ impl UserDefinedError for BPFError {}
/// Point all log messages to the log collector
macro_rules! log{
($logger:ident, $message:expr) => {
if let Ok(mut logger) = $logger.try_borrow_mut() {
if let Ok(logger) = $logger.try_borrow_mut() {
if logger.log_enabled() {
logger.log($message);
}
}
};
($logger:ident, $fmt:expr, $($arg:tt)*) => {
if let Ok(mut logger) = $logger.try_borrow_mut() {
if let Ok(logger) = $logger.try_borrow_mut() {
if logger.log_enabled() {
logger.log(&format!($fmt, $($arg)*));
}