Wire up Log throughout

This commit is contained in:
Chris Cannam
2022-06-22 11:33:36 +01:00
parent e8b63bd10d
commit 5137b19407
7 changed files with 194 additions and 393 deletions

View File

@@ -28,4 +28,27 @@ namespace RubberBand
int Log::m_defaultDebugLevel = 0;
Log
Log::makeCoutLog()
{
return Log(
[](const char *message) {
std::cout << "RubberBand: " << message << "\n";
},
[](const char *message, double arg0) {
auto prec = std::cout.precision();
std::cout.precision(10);
std::cout << "RubberBand: " << message << ": " << arg0 << "\n";
std::cout.precision(prec);
},
[](const char *message, double arg0, double arg1) {
auto prec = std::cout.precision();
std::cout.precision(10);
std::cout << "RubberBand: " << message
<< ": (" << arg0 << ", " << arg1 << ")" << "\n";
std::cout.precision(prec);
}
);
}
}