Skip to content

Commit

Permalink
Add song statistic logging for MIDI generator
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Jul 4, 2024
1 parent b0af6a0 commit 4a4dd64
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/lib_midi.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <fstream>
#include <sstream>

#include "ConfigJson.h"
#include "Music.h"
Expand Down Expand Up @@ -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;

}

0 comments on commit 4a4dd64

Please sign in to comment.