From 8d5b9bfc9539fe3f2fb6127a72a6b59e6ce285fd Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Sun, 28 Jun 2015 16:12:15 +0300 Subject: [PATCH] Improved debug output --- CrossBench/main.cpp | 4 ++-- src/crossgen.cpp | 8 +++----- wxCrossGen/wxCrossGen.txt | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CrossBench/main.cpp b/CrossBench/main.cpp index 4a59a97..5c90306 100644 --- a/CrossBench/main.cpp +++ b/CrossBench/main.cpp @@ -80,10 +80,10 @@ int main(int argc, char **argv) { durs.at(i) = wxGetLocalTimeMillis(); generateCross(grid,all_words,trans_type,words_out); if ( words_out.size() == 0 ) - wxPrintf(wxT("Error in creating #%i!\n"),i+1); + wxPrintf(wxT("Error in creating #%-2i!\n"),i+1); durs.at(i) = wxGetLocalTimeMillis() - durs.at(i); if ( is_verbose ) - wxPrintf(wxT("Time to generate #%i is ") + wxPrintf(wxT("Time to generate #%-2i is ") + durs.at(i).ToString() + wxT(" ms\n"), i+1); } wxLongLong tm_total = std::accumulate(durs.begin(),durs.end(), wxLongLong(0,0)); diff --git a/src/crossgen.cpp b/src/crossgen.cpp index 3db6a45..c2976fd 100644 --- a/src/crossgen.cpp +++ b/src/crossgen.cpp @@ -36,7 +36,7 @@ void readGrid(const wxString &path, GridType &grid){ ++i; } - wxLogDebug(wxT("Прочитана сетка размером %d x %d"), + wxLogDebug(wxT("Grid with size %2d x %2d is readden"), static_cast(grid.size()), static_cast(grid.at(0).size())); f.Close(); } @@ -101,10 +101,8 @@ void generateAllWords(const DictType &dict, AllWordsType &words_out, #ifndef NDEBUG wxLogDebug(wxT("Printing list of sorted letters:")); - for (auto i: freqs_sorted) - wxLogDebug(wxString(i)); for (auto i: freqs) - wxLogDebug(wxT("Freq of ") + wxString(i.first) + wxT(" is %d"), i.second); + wxLogDebug(wxT("Freq of ") + wxString(i.first) + wxT(" is %5d"), i.second); #endif // Function returns -1 if this word is so bad to include to dict @@ -321,7 +319,7 @@ void generateCross(const GridType &grid, const AllWordsType &words, std::vector winfos; generateWordInfo(grid, winfos); for (size_t i = 0; i < winfos.size(); ++i) - wxLogDebug(wxT("Word at (%d,%d) with len = %d and index = %d and dir = %d"), + wxLogDebug(wxT("Word at (%2d,%2d) with len = %2d and index = %2d and dir = %d"), winfos.at(i).x,winfos.at(i).y,winfos.at(i).len, winfos.at(i).ind, int(winfos.at(i).direct)); WorkGridType grid_work; diff --git a/wxCrossGen/wxCrossGen.txt b/wxCrossGen/wxCrossGen.txt index 37eff4d..0208c0b 100644 --- a/wxCrossGen/wxCrossGen.txt +++ b/wxCrossGen/wxCrossGen.txt @@ -1 +1 @@ -./Debug/main.cpp.o ./Debug/fmain.cpp.o ./Debug/fsettings.cpp.o ./Debug/src_crossexport.cpp.o ./Debug/src_crossgen.cpp.o ./Debug/fbgui_fbgui.cpp.o +../Release/main.cpp.o ../Release/fmain.cpp.o ../Release/fsettings.cpp.o ../Release/src_crossexport.cpp.o ../Release/src_crossgen.cpp.o ../Release/fbgui_fbgui.cpp.o