Skip to content

Commit 7d6b565

Browse files
committed
print warning message if backtrace capture is enabled
- helps to capture sudden performance issues
1 parent 737a40f commit 7d6b565

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

fyrox-impl/src/plugin/error.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
2323
use crate::{
2424
asset::state::LoadError,
25-
core::{dyntype::DynTypeError, pool::PoolError, visitor::error::VisitError},
25+
core::{dyntype::DynTypeError, pool::PoolError, visitor::error::VisitError, warn},
26+
graphics::error::FrameworkError,
2627
scene::graph::GraphError,
2728
};
28-
use fyrox_graphics::error::FrameworkError;
2929
use std::{
3030
backtrace::Backtrace,
3131
fmt::{Debug, Display, Formatter},
@@ -38,6 +38,13 @@ static CAPTURE_BACKTRACE: AtomicBool = AtomicBool::new(false);
3838
/// operation, so it is disabled by default.
3939
pub fn enable_backtrace_capture(capture: bool) {
4040
CAPTURE_BACKTRACE.store(capture, Ordering::Relaxed);
41+
42+
if capture {
43+
warn!(
44+
"Backtrace capture is enabled! This will negatively impact performance in \
45+
case of error spam."
46+
)
47+
}
4148
}
4249

4350
/// Returns `true` when the backtrace capture is one, `false` - otherwise.

0 commit comments

Comments
 (0)