From 4a4dd648cba0a217afca0aa13098d73c7e91d0ec Mon Sep 17 00:00:00 2001 From: dashodanger Date: Thu, 4 Jul 2024 01:12:22 -0600 Subject: [PATCH] Add song statistic logging for MIDI generator --- source/lib_midi.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/lib_midi.cc b/source/lib_midi.cc index 9bc35783d..45993c240 100644 --- a/source/lib_midi.cc +++ b/source/lib_midi.cc @@ -1,4 +1,5 @@ #include +#include #include "ConfigJson.h" #include "Music.h" @@ -47,7 +48,12 @@ bool steve_generate(const char *config_file, const char *out_file) { steve::Music music(config); std::ofstream fs(PathAppend(home_dir, out_file), std::ofstream::binary); music.write_mid(fs); + std::string music_debug; + std::ostringstream ss(music_debug); + music.write_txt(ss); + ss.flush(); + LogPrint("MIDI Statistics for %s:\n", out_file); + LogPrint("%s\n", ss.str().c_str()); return true; - }