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

@ -110,7 +110,7 @@ fn audio_trigger(
.iter()
.filter(|(_, _, source_event)| **source_event == AudioEvent::Idle)
.for_each(|(entity, source, _)| {
info!("Stopping audio {}", event_str);
debug!("Stopping audio {}", event_str);
source.stop();
commands.entity(entity).despawn_recursive();
});
@ -121,7 +121,7 @@ fn audio_trigger(
.iter()
.filter(|(_, _, source_event)| **source_event == AudioEvent::MainMusic)
.for_each(|(entity, source, _)| {
info!("Stopping audio {}", event_str);
debug!("Stopping audio {}", event_str);
source.stop();
commands.entity(entity).despawn_recursive();
});
@ -136,7 +136,7 @@ fn audio_trigger(
}
}
} 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()
.filter(|(_, event)| **event == AudioEvent::MainMusic)
.for_each(|(source, _)| {
info!("Setting music intensity to {:?}", value);
debug!("Setting music intensity to {:?}", value);
source
.event_instance
.set_parameter_by_name("Intensity", value, true)

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

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

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

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

@ -89,7 +89,7 @@ pub(crate) enum DisplayState {
/// Only runs when state is modified.
fn debug_state<S: States>(mut events: EventReader<StateTransitionEvent<S>>) {
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: Res<Assets<tweak::Tweaks>>,
) {
info!("Initializing Play menu");
debug!("Initializing Play menu");
let tweak = tweaks.get(tweaks_file.handle.clone()).expect("Load tweaks");
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");
info!("Initializing tutorial entities");
debug!("Initializing tutorial entities");
let background_hex = tweak.get::<String>("tutorial_rgba_background").unwrap();
let text_visible_hex = tweak.get::<String>("tutorial_rgba_visible").unwrap();
@ -552,7 +552,7 @@ fn activate_tutorial_step(
state: Res<State<TutorialState>>,
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
query.iter_mut().for_each(|(mut v, s)| {
@ -577,7 +577,7 @@ fn start_tutorial_on_play(
mut commands: Commands,
) {
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);
commands.insert_resource(TutorialStarted);
}

Loading…
Cancel
Save