Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 4 additions & 5 deletions ohkami/src/ohkami/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,10 @@ impl Ohkami {
});
}

crate::DEBUG!("interrupted, trying graceful shutdown...");
crate::INFO!("interrupted, trying graceful shutdown...");
drop(listener);

crate::DEBUG!("waiting {} session(s) to finish...", wg.count());
crate::INFO!("waiting {} session(s) to finish...", wg.count());
wg.await;
}

Expand Down Expand Up @@ -693,10 +693,10 @@ impl Ohkami {
});
}

crate::DEBUG!("interrupted, trying graceful shutdown...");
crate::INFO!("interrupted, trying graceful shutdown...");
drop(listener);

crate::DEBUG!("waiting {} session(s) to finish...", wg.count());
crate::INFO!("waiting {} session(s) to finish...", wg.count());
wg.await;
}

Expand Down Expand Up @@ -893,7 +893,6 @@ mod sync {
Self(NonNull::new(n).unwrap())
}

#[cfg(feature="DEBUG")]
pub fn count(&self) -> usize {
unsafe {self.0.as_ref()}.load(Ordering::Relaxed)
}
Expand Down
11 changes: 11 additions & 0 deletions ohkami/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ macro_rules! eprintln {
};
}

#[doc(hidden)]
#[macro_export]
macro_rules! INFO {
( $( $t:tt )* ) => {{
$crate::eprintln!(
"[ohkami:INFO] {}",
format_args!($($t)*)
);
}};
}

#[doc(hidden)]
#[macro_export]
macro_rules! WARNING {
Expand Down