From 782ccc1844fd3919d32bc08bc176741419670d7b Mon Sep 17 00:00:00 2001 From: Leonid Beynenson Date: Mon, 28 Nov 2011 20:44:41 +0000 Subject: [PATCH] Made changes in the stitching module to make correct logging on Android. --- .../include/opencv2/stitching/detail/util.hpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/stitching/include/opencv2/stitching/detail/util.hpp b/modules/stitching/include/opencv2/stitching/detail/util.hpp index 079361746..59a4e5646 100644 --- a/modules/stitching/include/opencv2/stitching/detail/util.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/util.hpp @@ -44,14 +44,27 @@ #define __OPENCV_STITCHING_UTIL_HPP__ #include +#include "cvconfig.h" #include "opencv2/core/core.hpp" #define ENABLE_LOG 1 // TODO remove LOG macros, add logging class #if ENABLE_LOG +#if ANDROID #include - #define LOG(msg) { std::cout << msg; std::cout.flush(); } + #include + #include + #define LOG(msg) \ + do { \ + std::stringstream _os; \ + _os << msg; \ + __android_log_print(ANDROID_LOG_DEBUG, "STITCHING", "%s", _os.str().c_str()); \ + } while(0); +#else + #include + #define LOG(msg) do { std::cout << msg; std::cout.flush(); } while(0); +#endif #else #define LOG(msg) #endif