Change all logging from info!/warn! to debug!

main
Elijah C. Voigt 1 year ago
parent 4b9e45d841
commit ba4414226f

@ -75,8 +75,8 @@ fn bogo_ai_thinking(
if !timer.finished() { if !timer.finished() {
timer.tick(time.delta()); timer.tick(time.delta());
} else { } else {
info!("AI finished thinking"); debug!("AI finished thinking");
info!("Timer: {:?}", timer); debug!("Timer: {:?}", timer);
// TODO: Assuming AI is Side::A // TODO: Assuming AI is Side::A
let ai_side = Side::A; let ai_side = Side::A;
@ -151,8 +151,8 @@ fn bogo_ai_holding(
if !timer.finished() { if !timer.finished() {
timer.tick(time.delta()); timer.tick(time.delta());
} else { } else {
info!("AI Holding"); debug!("AI Holding");
info!("Timer: {:?}", timer); debug!("Timer: {:?}", timer);
// Apply selected moves // Apply selected moves
board board

@ -110,7 +110,7 @@ fn audio_trigger(
.iter() .iter()
.filter(|(_, _, source_event)| **source_event == AudioEvent::Idle) .filter(|(_, _, source_event)| **source_event == AudioEvent::Idle)
.for_each(|(entity, source, _)| { .for_each(|(entity, source, _)| {
info!("Stopping audio {}", event_str); debug!("Stopping audio {}", event_str);
source.stop(); source.stop();
commands.entity(entity).despawn_recursive(); commands.entity(entity).despawn_recursive();
}); });
@ -121,7 +121,7 @@ fn audio_trigger(
.iter() .iter()
.filter(|(_, _, source_event)| **source_event == AudioEvent::MainMusic) .filter(|(_, _, source_event)| **source_event == AudioEvent::MainMusic)
.for_each(|(entity, source, _)| { .for_each(|(entity, source, _)| {
info!("Stopping audio {}", event_str); debug!("Stopping audio {}", event_str);
source.stop(); source.stop();
commands.entity(entity).despawn_recursive(); commands.entity(entity).despawn_recursive();
}); });
@ -136,7 +136,7 @@ fn audio_trigger(
} }
} }
} else { } else {
warn!("No music set for {:?} in {:?}", event, state); debug!("No music set for {:?} in {:?}", event, state);
} }
} }
}); });
@ -182,7 +182,7 @@ fn set_intensity(
.iter() .iter()
.filter(|(_, event)| **event == AudioEvent::MainMusic) .filter(|(_, event)| **event == AudioEvent::MainMusic)
.for_each(|(source, _)| { .for_each(|(source, _)| {
info!("Setting music intensity to {:?}", value); debug!("Setting music intensity to {:?}", value);
source source
.event_instance .event_instance
.set_parameter_by_name("Intensity", value, true) .set_parameter_by_name("Intensity", value, true)

@ -510,7 +510,7 @@ fn update_tweaks(
tweaks: Res<Assets<Tweaks>>, tweaks: Res<Assets<Tweaks>>,
) { ) {
if let Some(tweak) = tweaks.get(tweaks_file.handle.clone()) { if let Some(tweak) = tweaks.get(tweaks_file.handle.clone()) {
warn!("Updating tweaks!"); debug!("Updating tweaks!");
camera_settings camera_settings
.iter_mut() .iter_mut()
.for_each(|(mut skybox, mut environment_map_light)| { .for_each(|(mut skybox, mut environment_map_light)| {
@ -567,7 +567,7 @@ fn set_models(
if active_animation_players if active_animation_players
.iter_many(children.iter_descendants(entity)) .iter_many(children.iter_descendants(entity))
.count() > 0 { .count() > 0 {
info!("Piece {:?} is animating. Skipping...", entity); debug!("Piece {:?} is animating. Skipping...", entity);
} else { } else {
let scene = tweak.get::<String>(key).unwrap(); let scene = tweak.get::<String>(key).unwrap();
let new_handle = gltf.named_scenes.get(scene.as_str()).expect("Game board model"); let new_handle = gltf.named_scenes.get(scene.as_str()).expect("Game board model");
@ -1042,7 +1042,7 @@ fn vantage_point(
.unwrap(); .unwrap();
let gltf = gltfs.get(assets_handle).expect("Load GLTF content"); let gltf = gltfs.get(assets_handle).expect("Load GLTF content");
players.iter_mut().for_each(|mut player| { players.iter_mut().for_each(|mut player| {
info!("Getting a better view"); debug!("Getting a better view");
// play down events on state transitions // play down events on state transitions
let animation_key = if !*up { let animation_key = if !*up {
@ -1296,7 +1296,6 @@ fn dissolve_animation(
entity, percentage entity, percentage
); );
// info!("Removing dissolving marker from {:?}", entity);
commands.entity(entity).remove::<Dissolving>(); commands.entity(entity).remove::<Dissolving>();
} }
}); });

@ -510,7 +510,7 @@ impl Board {
} }
} }
info!("Remaining moves: {:?}", self.moves); debug!("Remaining moves: {:?}", self.moves);
return moves; return moves;
} }
@ -1105,7 +1105,7 @@ pub(crate) fn update_board(
match to { match to {
// If we are moving on the board... // If we are moving on the board...
Some(to_idx) => { Some(to_idx) => {
info!("Moving piece {:?} {:?} -> {:?}", entity, from, to_idx); debug!("Moving piece {:?} {:?} -> {:?}", entity, from, to_idx);
// Update the piece's index // Update the piece's index
*index = *to_idx; *index = *to_idx;
// Play audio sfx // Play audio sfx
@ -1125,7 +1125,7 @@ pub(crate) fn update_board(
} }
let ns = !*curr_state.get(); let ns = !*curr_state.get();
info!("Piece moved, switching sides: {:?}", ns); debug!("Piece moved, switching sides: {:?}", ns);
next_state.set(ns); next_state.set(ns);
} }
} }
@ -1133,7 +1133,7 @@ pub(crate) fn update_board(
None => { None => {
match move_type { match move_type {
MoveType::Capture => { MoveType::Capture => {
info!("Capturing piece {:?}", entity); debug!("Capturing piece {:?}", entity);
commands commands
.entity(entity) .entity(entity)
.remove::<BoardIndex>() .remove::<BoardIndex>()
@ -1390,7 +1390,7 @@ fn handle_selection(
.iter() .iter()
.filter(|(_, this_index)| *this_index == index) .filter(|(_, this_index)| *this_index == index)
.for_each(|(piece, piece_index)| { .for_each(|(piece, piece_index)| {
info!("Selecting {:?} at {:?}", piece, piece_index); debug!("Selecting {:?} at {:?}", piece, piece_index);
commands.entity(piece).insert(Selected); commands.entity(piece).insert(Selected);
if !(*done) { if !(*done) {
audio_event.send(audio::AudioEvent::PickUp); audio_event.send(audio::AudioEvent::PickUp);
@ -1409,7 +1409,7 @@ fn handle_selection(
match board.move_piece(*current_index, *index) { match board.move_piece(*current_index, *index) {
Ok(moves) => { Ok(moves) => {
// De-select the piece // De-select the piece
info!("Applying moves {:?}", moves); debug!("Applying moves {:?}", moves);
if !(*done) { if !(*done) {
moves.iter().for_each(|m| { moves.iter().for_each(|m| {
move_events.send(m.clone()); move_events.send(m.clone());
@ -1417,9 +1417,9 @@ fn handle_selection(
*done = true; *done = true;
} }
} }
Err(GameError::NullMove) => warn!("Null move!"), Err(GameError::NullMove) => debug!("Null move!"),
Err(GameError::InvalidIndex) | Err(GameError::InvalidMove) => { Err(GameError::InvalidIndex) | Err(GameError::InvalidMove) => {
warn!("Invalid index/move!"); debug!("Invalid index/move!");
if !(*done) { if !(*done) {
audio_event.send(AudioEvent::Invalid); audio_event.send(AudioEvent::Invalid);
*done = true; *done = true;
@ -1442,7 +1442,7 @@ fn asserts<T: Component>(
) { ) {
if selected_pieces.iter().len() > 2 { if selected_pieces.iter().len() > 2 {
selected_pieces.iter().for_each(|e| { selected_pieces.iter().for_each(|e| {
info!("Too many pieces selected, one of which is: {:?}", e); debug!("Too many pieces selected, one of which is: {:?}", e);
}); });
panic!( panic!(
"More than two pieces selected {:?}", "More than two pieces selected {:?}",
@ -1475,7 +1475,7 @@ fn show_valid_moves(
// Iterate over all ValidMove entities // Iterate over all ValidMove entities
// For each one with a ValidMove index, make it visible // For each one with a ValidMove index, make it visible
let valid_moves = board.valid_moves(*idx); let valid_moves = board.valid_moves(*idx);
info!("Showing valid moves for {:?}: {:?}", idx, valid_moves); debug!("Showing valid moves for {:?}: {:?}", idx, valid_moves);
indicators.iter_mut().for_each(|(i, mut vis)| { indicators.iter_mut().for_each(|(i, mut vis)| {
if valid_moves.contains(i) { if valid_moves.contains(i) {
*vis = Visibility::Inherited; *vis = Visibility::Inherited;
@ -1539,7 +1539,7 @@ fn assert_piece_consistency(
let active_count = active.iter().len(); let active_count = active.iter().len();
let being_captured_count = being_captured.iter().len(); let being_captured_count = being_captured.iter().len();
let captured_count = captured.iter().len(); let captured_count = captured.iter().len();
info!("Active: {} | being captured: {} | captured: {}", active_count, being_captured_count, captured_count); debug!("Active: {} | being captured: {} | captured: {}", active_count, being_captured_count, captured_count);
let total_count = active_count + being_captured_count + captured_count; let total_count = active_count + being_captured_count + captured_count;
assert_eq!(total_count, 18, "Pieces does does not add up!"); assert_eq!(total_count, 18, "Pieces does does not add up!");
} }
@ -1565,8 +1565,10 @@ fn undo_move(
side = !turn.get().0; side = !turn.get().0;
} }
info!("Reverting move {:?} {:?} -> {:?}", epoch, from, to); debug!("Reverting move {:?} {:?} -> {:?}", epoch, from, to);
match to { Some(to_idx) => { info!("Moving piece back from {:?}", to_idx); match to { Some(to_idx) => {
debug!("Moving piece back from {:?}", to_idx);
// Find piece currently at "to_idx" and update it's position to "from" // Find piece currently at "to_idx" and update it's position to "from"
active_pieces active_pieces
.iter_mut() .iter_mut()

@ -73,7 +73,7 @@ fn set_text_animation_speed(
TextAnimationSpeed::default() TextAnimationSpeed::default()
}; };
info!("Set animation speeds {:?}", *animation_speed); debug!("Set animation speeds {:?}", *animation_speed);
} }
// Draw the intro text (invisible) on startup // Draw the intro text (invisible) on startup
@ -157,7 +157,7 @@ fn manage_intro(
query: Query<Entity, (With<Node>, With<IntroUi>, Without<Parent>)>, query: Query<Entity, (With<Node>, With<IntroUi>, Without<Parent>)>,
mut commands: Commands, mut commands: Commands,
) { ) {
info!("Managing intro"); debug!("Managing intro");
query.iter().for_each(|e| { query.iter().for_each(|e| {
commands commands
.entity(e) .entity(e)
@ -174,7 +174,7 @@ fn cleanup_intro(
tweaks: Res<Assets<tweak::Tweaks>>, tweaks: Res<Assets<tweak::Tweaks>>,
mut commands: Commands, mut commands: Commands,
) { ) {
info!("Cleaning up intro"); debug!("Cleaning up intro");
query.iter().for_each(|e| { query.iter().for_each(|e| {
commands commands
@ -222,14 +222,14 @@ fn manage_scroll_text_animation(
mut keys: ResMut<ButtonInput<KeyCode>>, mut keys: ResMut<ButtonInput<KeyCode>>,
mut mouse: ResMut<ButtonInput<MouseButton>>, mut mouse: ResMut<ButtonInput<MouseButton>>,
) { ) {
info!("Managing scroll text animation"); debug!("Managing scroll text animation");
roots.iter().for_each(|r| { roots.iter().for_each(|r| {
info!("Processing {:?} at frame {:?}", r, framecount.0); debug!("Processing {:?} at frame {:?}", r, framecount.0);
// Skip to next paragraph only the current paragraph's animation is complete // Skip to next paragraph only the current paragraph's animation is complete
if animated_texts.is_empty() { if animated_texts.is_empty() {
info!( debug!(
"No animations playing, moving on to next paragraph {:?}", "No animations playing, moving on to next paragraph {:?}",
curr.0 curr.0
); );
@ -258,7 +258,7 @@ fn manage_scroll_text_animation(
// Operate on the next entity in the list // Operate on the next entity in the list
curr.0 = paragraphs.next(); curr.0 = paragraphs.next();
info!("Curr: {:?}", curr.0); debug!("Curr: {:?}", curr.0);
// Progress to the next paragraph // Progress to the next paragraph
if let Some(e) = curr.0 { if let Some(e) = curr.0 {

@ -79,8 +79,8 @@ fn loading(
.all(|id| server.is_loaded_with_dependencies(id)); .all(|id| server.is_loaded_with_dependencies(id));
if s && g && t && f { if s && g && t && f {
info!("Loading complete after {:?} seconds", time.elapsed_seconds()); debug!("Loading complete after {:?} seconds", time.elapsed_seconds());
info!("Starting game intro"); debug!("Starting game intro");
next_state.set(GameState::Intro) next_state.set(GameState::Intro)
} }
} }

@ -89,7 +89,7 @@ pub(crate) enum DisplayState {
/// Only runs when state is modified. /// Only runs when state is modified.
fn debug_state<S: States>(mut events: EventReader<StateTransitionEvent<S>>) { fn debug_state<S: States>(mut events: EventReader<StateTransitionEvent<S>>) {
events.read().for_each(|event| { events.read().for_each(|event| {
info!("State change {:?} -> {:?}", event.before, event.after); debug!("State change {:?} -> {:?}", event.before, event.after);
}) })
} }

@ -46,7 +46,7 @@ fn init_play_menu(
tweaks_file: Res<tweak::GameTweaks>, tweaks_file: Res<tweak::GameTweaks>,
tweaks: Res<Assets<tweak::Tweaks>>, tweaks: Res<Assets<tweak::Tweaks>>,
) { ) {
info!("Initializing Play menu"); debug!("Initializing Play menu");
let tweak = tweaks.get(tweaks_file.handle.clone()).expect("Load tweaks"); let tweak = tweaks.get(tweaks_file.handle.clone()).expect("Load tweaks");
let button_handle = tweak.get_handle::<Image>("buttons_image_resting").unwrap(); let button_handle = tweak.get_handle::<Image>("buttons_image_resting").unwrap();

@ -90,7 +90,7 @@ fn initialize_tutorial(
) { ) {
let tweak = tweaks.get(tweaks_file.handle.clone()).expect("Load tweaks"); let tweak = tweaks.get(tweaks_file.handle.clone()).expect("Load tweaks");
info!("Initializing tutorial entities"); debug!("Initializing tutorial entities");
let background_hex = tweak.get::<String>("tutorial_rgba_background").unwrap(); let background_hex = tweak.get::<String>("tutorial_rgba_background").unwrap();
let text_visible_hex = tweak.get::<String>("tutorial_rgba_visible").unwrap(); let text_visible_hex = tweak.get::<String>("tutorial_rgba_visible").unwrap();
@ -552,7 +552,7 @@ fn activate_tutorial_step(
state: Res<State<TutorialState>>, state: Res<State<TutorialState>>,
mut query: Query<(&mut Visibility, &TutorialState), Without<GameState>>, mut query: Query<(&mut Visibility, &TutorialState), Without<GameState>>,
) { ) {
info!("Activating tutorial step {:?}", state.get()); debug!("Activating tutorial step {:?}", state.get());
// Iterate over all entities with TutorialState components // Iterate over all entities with TutorialState components
query.iter_mut().for_each(|(mut v, s)| { query.iter_mut().for_each(|(mut v, s)| {
@ -577,7 +577,7 @@ fn start_tutorial_on_play(
mut commands: Commands, mut commands: Commands,
) { ) {
if query.iter().len() == 0 && *state.get() == TutorialState::None && board.current_epoch() <= 1 { if query.iter().len() == 0 && *state.get() == TutorialState::None && board.current_epoch() <= 1 {
info!("Starting intro tutorial!"); debug!("Starting intro tutorial!");
next_state.set(TutorialState::Intro); next_state.set(TutorialState::Intro);
commands.insert_resource(TutorialStarted); commands.insert_resource(TutorialStarted);
} }

Loading…
Cancel
Save