bevy_log/once.rs
1/// Call [`trace!`](crate::trace) once per call site.
2///
3/// Useful for logging within systems which are called every frame.
4#[macro_export]
5macro_rules! trace_once {
6 ($($arg:tt)+) => ({
7 $crate::once!($crate::trace!($($arg)+))
8 });
9}
10
11/// Call [`debug!`](crate::debug) once per call site.
12///
13/// Useful for logging within systems which are called every frame.
14#[macro_export]
15macro_rules! debug_once {
16 ($($arg:tt)+) => ({
17 $crate::once!($crate::debug!($($arg)+))
18 });
19}
20
21/// Call [`info!`](crate::info) once per call site.
22///
23/// Useful for logging within systems which are called every frame.
24#[macro_export]
25macro_rules! info_once {
26 ($($arg:tt)+) => ({
27 $crate::once!($crate::info!($($arg)+))
28 });
29}
30
31/// Call [`warn!`](crate::warn) once per call site.
32///
33/// Useful for logging within systems which are called every frame.
34#[macro_export]
35macro_rules! warn_once {
36 ($($arg:tt)+) => ({
37 $crate::once!($crate::warn!($($arg)+))
38 });
39}
40
41/// Call [`error!`](crate::error) once per call site.
42///
43/// Useful for logging within systems which are called every frame.
44#[macro_export]
45macro_rules! error_once {
46 ($($arg:tt)+) => ({
47 $crate::once!($crate::error!($($arg)+))
48 });
49}