Skip to content

Commit

Permalink
log levels ("huge" logging overhaul)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnackmclain committed Sep 23, 2023
1 parent 59bb85c commit 80b28ea
Show file tree
Hide file tree
Showing 27 changed files with 879 additions and 697 deletions.
12 changes: 0 additions & 12 deletions _ark/config/beatmatcher.dta
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@
DX_MTV_BPM_HANDLER
DX_BOT_OVERDRIVE_DEPLETION_HANDLER
DX_COUNTDOWN_TRACKER
;{{{{get_track_panel} loaded_dir} vocals} set vox_configuration vocals_remote_top_wide}
;{set $dx_whatever {{{{get_track_panel} loaded_dir} vocals} get feedback_state_lead}}
;{{{get_track_panel} find vocals} cycle_pitch_guides}
;{{{get_track_panel} find vocals} cycle_arrow_style}
;{{{get_track_panel} find vocals} cycle_font_style}
;{{{get_track_panel} find vocals} toggle_pitch_window}
;{{{get_track_panel} find vocals} toggle_harmony_lyrics}
;{{{get_track_panel} find vocals} toggle_lead_lyrics}
;{{{get_track_panel} find vocals} cycle_tube_style}
;{if $dx_whatever
;{dx_log_writer TRUE {sprint "Feedback found: " $dx_whatever}}
;}
#ifdef HX_WII
{unless
$stagekit
Expand Down
74 changes: 41 additions & 33 deletions _ark/dx/funcs/dx_game_funcs.dta
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
{func
dx_bot_overdrive_handler
;runs in beatmatcher, do not add log
{if {&& {== $dx_bot_overdrive dx_on} {! DX_ALL_BOTS_ENABLED}}
{do
{set $dx_tmp FALSE}
{beatmatch foreach_active_player $player
{if {$player is_deploying} {set $dx_tmp TRUE}}
}
{if {&& {>= {beatmatch num_active_players} 1} $dx_bot_1}
{set $player {beatmatch active_player 0}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
{if {&& {>= {beatmatch num_active_players} 2} $dx_bot_2}
{set $player {beatmatch active_player 1}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
{if {&& {>= {beatmatch num_active_players} 3} $dx_bot_3}
{set $player {beatmatch active_player 2}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
{if {&& {>= {beatmatch num_active_players} 4} $dx_bot_4}
{set $player {beatmatch active_player 3}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
{if {&& {>= {beatmatch num_active_players} 5} $dx_bot_5}
{set $player {beatmatch active_player 4}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
}
}
;{dx_log_writer TRUE {sprint "func: dx_bot_overdrive_handler - Current Screen: " {ui current_screen} " - Gamemode: " $dx_gamemode}}
;{dx_log_writer TRUE
; {sprintf "Executed - time: %.4fms"
; {time
{if {&& {== $dx_bot_overdrive dx_on} {! DX_ALL_BOTS_ENABLED}}
{do
{set $dx_tmp FALSE}
{beatmatch foreach_active_player $player
{if {$player is_deploying} {set $dx_tmp TRUE}}
}
{if {&& {>= {beatmatch num_active_players} 1} $dx_bot_1}
{set $player {beatmatch active_player 0}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
{if {&& {>= {beatmatch num_active_players} 2} $dx_bot_2}
{set $player {beatmatch active_player 1}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
{if {&& {>= {beatmatch num_active_players} 3} $dx_bot_3}
{set $player {beatmatch active_player 2}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
{if {&& {>= {beatmatch num_active_players} 4} $dx_bot_4}
{set $player {beatmatch active_player 3}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
{if {&& {>= {beatmatch num_active_players} 5} $dx_bot_5}
{set $player {beatmatch active_player 4}}
{if $dx_tmp {$player deploy_if_possible}}
{if {>= {$player band_energy} 1} {$player deploy_if_possible}}
}
}
}
; }
; }
;}
}
{func
dx_ms_to_time_str
Expand All @@ -47,4 +54,5 @@
{func
dx_uptime
{dx_passive_messenger_symbol {sprintf "RB3DX Uptime\n%s" {dx_ms_to_time_str {system_ms} FALSE}}}
{dx_log_writer TRUE {sprintf "RB3DX Uptime\n%s" {dx_ms_to_time_str {system_ms} FALSE}}}
}
6 changes: 4 additions & 2 deletions _ark/dx/locale/dx_locale_updates.dta
Original file line number Diff line number Diff line change
Expand Up @@ -1203,8 +1203,10 @@
"Visiblity: NEVER")
(os_mtv_vis_default
"Visiblity: DEFAULT")
(os_logging_always
"Logging: ALWAYS")
(os_logging_insane
"Logging: INSANE")
(os_logging_info
"Logging: INFO")
(os_logging_never
"Logging: NEVER")
(os_logging_default
Expand Down
2 changes: 1 addition & 1 deletion _ark/dx/macros/dx_conf_macros.dta
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
{modifier_mgr is_modifier_active mod_auto_kick}
}
{do
{dx_log_writer TRUE {sprint "Auto Play/Kick detected. Disconnecting from session. Current Screen: " {ui current_screen} " - Gamemode: " $dx_gamemode}}
{dx_log_writer default {sprint "Auto Play/Kick detected. Disconnecting from session. Current Screen: " {ui current_screen} " - Gamemode: " $dx_gamemode}}
{session send_msg_to_all {'`' (ui goto_screen meta_loading_main_screen) kNetReliable}}
{session send_msg_to_all {'`' (session disconnect) kNetReliable}}
{session send_msg_to_all {'`' (session_mgr disconnect) kNetReliable}}
Expand Down
22 changes: 11 additions & 11 deletions _ark/dx/macros/dx_endgame_macros.dta
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{set $dx_num_songs_this_session
{+ $dx_num_songs_this_session 1}
}
{dx_log_writer FALSE {sprint "Endgame stats - Song: " {{song_mgr get_meta_data {meta_performer get_completed_song}} title} " (" {int {'+' 0.5 {'*' $speedmod 100}}} "%) - User: " {$user get_track_icon} " - Difficulty: " {$user get_difficulty_sym} " - Percentage: " {int {'*' 100 {{$user player} notes_hit_fraction}}} "% - Band Score: " {{beatmatch main_performer} accumulated_score}}}
{dx_log_writer TRUE {sprint "Setting endgame information for: " {$user get_track_icon}}}
{dx_log_writer default {sprint "Endgame stats - Song: " {{song_mgr get_meta_data {meta_performer get_completed_song}} title} " (" {int {'+' 0.5 {'*' $speedmod 100}}} "%) - User: " {$user get_track_icon} " - Difficulty: " {$user get_difficulty_sym} " - Percentage: " {int {'*' 100 {{$user player} notes_hit_fraction}}} "% - Band Score: " {{beatmatch main_performer} accumulated_score}}}
{dx_log_writer info {sprint "Setting endgame information for: " {$user get_track_icon}}}
{if_else
{&&
{modifier_mgr is_modifier_active mod_fastermode} ; if we are in acceleration mode
Expand All @@ -27,7 +27,7 @@
}
}
{do
{dx_log_writer FALSE {sprint "User " {$user get_track_icon} " in acceleration mode."}}
{dx_log_writer info {sprint "User " {$user get_track_icon} " in acceleration mode."}}
{noteshit_details.lbl set_token_fmt ;hard set the score percentage ourselves for acceleration mode
{sprint
{int {'*' 100 {{$user player} notes_hit_fraction}}} ; print the notes hit then the difficulty letter
Expand Down Expand Up @@ -55,7 +55,7 @@
(
{if_else {modifier_mgr is_modifier_active mod_auto_play} ;check if in autoplay
{do
{dx_log_writer FALSE {sprint "Autoplay detected for user: " {$user get_track_icon}}}
{dx_log_writer info {sprint "Autoplay detected for user: " {$user get_track_icon}}}
{difficulty_details.lbl set_token_fmt ;report autoplay with diff
{sprint
{localize {$user get_difficulty_sym}}
Expand All @@ -67,7 +67,7 @@
}
{if_else {&& {|| {== {$user get_track_icon} "G"} {== {$user get_track_icon} "B"}} {modifier_mgr is_modifier_active mod_chmode}} ;check if guitar or bass are in ch mode
{do
{dx_log_writer FALSE {sprint "CH Mode detected for user: " {$user get_track_icon}}}
{dx_log_writer info {sprint "CH Mode detected for user: " {$user get_track_icon}}}
{difficulty_details.lbl set_token_fmt ;report ch mode for guitar and bass with diff
{sprint
{localize {$user get_difficulty_sym}}
Expand All @@ -79,7 +79,7 @@
}
{if_else {&& {|| {== {$user get_track_icon} "G"} {== {$user get_track_icon} "B"} {== {$user get_track_icon} "d"} {== {$user get_track_icon} "D"}} {modifier_mgr is_modifier_active mod_fastermode}} ;check if drum or pro drum has auto kick
{do
{dx_log_writer FALSE {sprint "User " {$user get_track_icon} " Top Speed: " {int {'+' 0.5 {'*' $speedmod_top 100}}}"%"}}
{dx_log_writer info {sprint "User " {$user get_track_icon} " Top Speed: " {int {'+' 0.5 {'*' $speedmod_top 100}}}"%"}}
{difficulty_details.lbl set_token_fmt ;report autokick for drum or pro drum
{sprint
{localize mod_fastermode_topspeed}
Expand All @@ -91,7 +91,7 @@
}
{if_else {&& {|| {== {$user get_track_icon} "d"} {== {$user get_track_icon} "D"}} {modifier_mgr is_modifier_active mod_auto_kick}} ;check if drum or pro drum has auto kick
{do
{dx_log_writer FALSE {sprint "Auto Kick detected for user: " {$user get_track_icon}}}
{dx_log_writer info {sprint "Auto Kick detected for user: " {$user get_track_icon}}}
{difficulty_details.lbl set_token_fmt ;report autokick for drum or pro drum
{sprint
{localize {$user get_difficulty_sym}}
Expand Down Expand Up @@ -121,7 +121,7 @@
)
#define DX_ENDGAME_SFX_PLAYER
(
{dx_log_writer FALSE {sprint "Checking player thresholds for sound effects - FC: " $dx_someone_fcd " NICE: " $dx_someone_niced " JURGEN: " $dx_someone_jurgend}}
{dx_log_writer info {sprint "Checking player thresholds for sound effects - FC: " $dx_someone_fcd " NICE: " $dx_someone_niced " JURGEN: " $dx_someone_jurgend}}
{if $dx_someone_fcd ;play our sounds based on the song results
{coop_endgame_panel fc_clip}
}
Expand All @@ -140,7 +140,7 @@
(
(fc_clip
{unless {== $dx_fullcombo_sound dx_none}
{dx_log_writer FALSE {sprint "Playing FC Sound. Congrats"}}
{dx_log_writer default {sprint "Playing FC Sound. Congrats"}}
{unless {exists fc_clip}
{new MoggClip fc_clip}
}
Expand All @@ -153,7 +153,7 @@
}
)
(nice_clip
{dx_log_writer FALSE {sprint "Playing Nice Sound. Nice"}}
{dx_log_writer default {sprint "Playing Nice Sound. Nice"}}
{unless {exists nice_clip}
{new MoggClip nice_clip}
}
Expand All @@ -167,7 +167,7 @@
}
)
(jurgen_clip
{dx_log_writer FALSE {sprint "Playing Jurgen Sound. Skill Issue"}}
{dx_log_writer default {sprint "Playing Jurgen Sound. Skill Issue"}}
{unless {exists jurgen_clip}
{new MoggClip jurgen_clip}
}
Expand Down
16 changes: 8 additions & 8 deletions _ark/dx/macros/dx_game_macros.dta
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(
{if_else {|| {modifier_mgr is_modifier_active mod_auto_play} $otherautoplay}
{do
{dx_log_writer FALSE {sprint "Setting Autoplayers - 1: " $dx_bot_1 " - 2: " $dx_bot_2 " - 3: " $dx_bot_3 " - 4: " $dx_bot_4 " - 5: " $dx_bot_5}}
{dx_log_writer info {sprint "Setting Autoplayers - 1: " $dx_bot_1 " - 2: " $dx_bot_2 " - 3: " $dx_bot_3 " - 4: " $dx_bot_4 " - 5: " $dx_bot_5}}
{if {>= {beatmatch num_active_players} 1}
{{beatmatch active_player 0} set_auto_play $dx_bot_1}
}
Expand Down Expand Up @@ -66,7 +66,7 @@
)
#define DX_VENUE_SETTER
(
{dx_log_writer FALSE {sprint "Setting Venue - Current Screen: " {ui current_screen} " - Gamemode: " $dx_gamemode}}
{dx_log_writer info {sprint "Setting Venue - Current Screen: " {ui current_screen} " - Gamemode: " $dx_gamemode}}
{if
{&&
{||
Expand Down Expand Up @@ -120,7 +120,7 @@
}
}
}
{dx_log_writer FALSE {sprint "Venue set to " $dx_venue " - Forced: " $force}}
{dx_log_writer default {sprint "Venue set to " $dx_venue " - Forced: " $force}}
}
)
#define DX_SWAP_VENUE_MID_SETLIST
Expand Down Expand Up @@ -179,7 +179,7 @@
#define DX_LEADER_SPEED_SETTER
(
{if {is_leader_local} ; dx - sync speeds only if currently the lobby leader
;{dx_log_writer FALSE {sprint "Sending Leader Speed to peers, Leaderspeed: " $leaderspeed " - Current Screen: " {ui current_screen} " - Gamemode: " $dx_gamemode}}
;{dx_log_writer insane {sprint "Sending Leader Speed to peers, Leaderspeed: " $leaderspeed " - Current Screen: " {ui current_screen} " - Gamemode: " $dx_gamemode}}
DX_DISCONNECT
{set $speedmod $leaderspeed}
{set $speedmod_top $leaderspeed}
Expand All @@ -189,7 +189,7 @@
#define DX_SET_SPEEDS
(
{if {exists gamemode}
;{dx_log_writer FALSE {sprint "Setting up song speeds. Song Speed: " $speedmod}} ;runs in beatmatcher, do not enable under penalty of stutter
;{dx_log_writer insane {sprint "Setting up song speeds. Song Speed: " $speedmod}} ;runs in beatmatcher, do not enable under penalty of stutter
{unless
{|| ;check for a variety of game modes where song speed is not allowed to be adjusted
{gamemode in_mode pro_song_lessons_keyboard} {gamemode in_mode pro_song_lessons_real_guitar}
Expand Down Expand Up @@ -281,7 +281,7 @@
)
#define DX_GAME_RESET_HANDLER
(
;{dx_log_writer FALSE {sprint "Clearing Song Variables" " - Current Screen: " {ui current_screen}}} ;stutters at song end, dont enable unless you really mean it
;{dx_log_writer insane {sprint "Clearing Song Variables" " - Current Screen: " {ui current_screen}}} ;stutters at song end, dont enable unless you really mean it
;clears out the variables used for song information, sinks, and callbacks to be populated again
{set $guitar_milosong FALSE}
{set $bass_milosong FALSE}
Expand Down Expand Up @@ -407,7 +407,7 @@
)
#define DX_MTV_RESET_HANDLER
(
;{dx_log_writer FALSE {sprint "Clearing MTV Variables - Current Screen: " {ui current_screen}}} ;stutters at song end, dont enable unless you really mean it
;{dx_log_writer insane {sprint "Clearing MTV Variables - Current Screen: " {ui current_screen}}} ;stutters at song end, dont enable unless you really mean it
;mtv
{set $song_title FALSE}
{set $authorvar FALSE}
Expand Down Expand Up @@ -448,7 +448,7 @@
)
#define DX_TEXTURE_RESET_HANDLER
(
;{dx_log_writer FALSE {sprint "Resetting Custom Textures to Default - Current Screen: " {ui current_screen}}}
;{dx_log_writer insane {sprint "Resetting Custom Textures to Default - Current Screen: " {ui current_screen}}}
{if {== $dx_smasher "rock band 3"} {set $dx_smasher none}}

{if {== $dx_gem "rock band 3"} {set $dx_gem none}}
Expand Down
10 changes: 5 additions & 5 deletions _ark/dx/macros/dx_midi_parsers.dta
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{push_back $guitar_note_tracker ({sprint "delay_" $tracked_break_num_guitar} $guitar_tracked_prev_end $guitar_tracked_start)}
{set $guitar_note_tracker {array $guitar_note_tracker}}
{set $tracked_break_num_guitar {+ $tracked_break_num_guitar 1}}
;{dx_log_writer TRUE $guitar_note_tracker}
;{dx_log_writer info $guitar_note_tracker}
}
{set $dx_final_note_guitar {int $mp.start}}
{if {> $dx_final_note_guitar $dx_final_note} {set $dx_final_note $dx_final_note_guitar}}
Expand Down Expand Up @@ -58,7 +58,7 @@
{push_back $drum_note_tracker ({sprint "delay_" $tracked_break_num_drum} $drum_tracked_prev_end $drum_tracked_start)}
{set $drum_note_tracker {array $drum_note_tracker}}
{set $tracked_break_num_drum {+ $tracked_break_num_drum 1}}
;{dx_log_writer TRUE $drum_note_tracker}
;{dx_log_writer info $drum_note_tracker}
}
{set $dx_final_note_drum {int $mp.start}}
{if {> $dx_final_note_drum $dx_final_note} {set $dx_final_note $dx_final_note_drum}}
Expand Down Expand Up @@ -91,7 +91,7 @@
{push_back $bass_note_tracker ({sprint "delay_" $tracked_break_num_bass} $bass_tracked_prev_end $bass_tracked_start)}
{set $bass_note_tracker {array $bass_note_tracker}}
{set $tracked_break_num_bass {+ $tracked_break_num_bass 1}}
;{dx_log_writer TRUE $bass_note_tracker}
;{dx_log_writer info $bass_note_tracker}
}
{set $dx_final_note_bass {int $mp.start}}
{if {> $dx_final_note_bass $dx_final_note} {set $dx_final_note $dx_final_note_bass}}
Expand Down Expand Up @@ -125,7 +125,7 @@
{push_back $keys_note_tracker ({sprint "delay_" $tracked_break_num_keys} $keys_tracked_prev_end $keys_tracked_start)}
{set $keys_note_tracker {array $keys_note_tracker}}
{set $tracked_break_num_keys {+ $tracked_break_num_keys 1}}
;{dx_log_writer TRUE $keys_note_tracker}
;{dx_log_writer info $keys_note_tracker}
}
{set $dx_final_note_keys {int $mp.start}}
{if {> $dx_final_note_keys $dx_final_note} {set $dx_final_note $dx_final_note_keys}}
Expand Down Expand Up @@ -163,7 +163,7 @@
{push_back $vocals_note_tracker ({sprint "delay_" $tracked_break_num_vocals} $vocals_tracked_prev_end $vocals_tracked_start)}
{set $vocals_note_tracker {array $vocals_note_tracker}}
{set $tracked_break_num_vocals {+ $tracked_break_num_vocals 1}}
;{dx_log_writer TRUE $vocals_note_tracker}
;{dx_log_writer info $vocals_note_tracker}
}
{set $dx_final_note_vocals {int $mp.start}}
{if {> $dx_final_note_vocals $dx_final_note} {set $dx_final_note $dx_final_note_vocals}}
Expand Down
4 changes: 2 additions & 2 deletions _ark/dx/macros/dx_paths.dta
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
(check_dx
{unless {file_exists DX_SETTINGS_FILE_PATH}
{unless $dxwelcomeseen
{dx_log_writer FALSE {sprint "Cannot find DX.dta"}}
{dx_log_writer info {sprint "Cannot find DX.dta"}}
{ui push_screen hint_dx_welcome_screen}
}
}
Expand All @@ -95,7 +95,7 @@
{unless {file_exists DX_SETTINGS_FILE_PATH}
{if $dxwelcomeseen
{unless $dx_settings_error
{dx_log_writer FALSE {sprint "Cannot write DX.dta"}}
{dx_log_writer info {sprint "Cannot write DX.dta"}}
{ui push_screen hint_relative_writes_screen}
}
}
Expand Down
Loading

0 comments on commit 80b28ea

Please sign in to comment.