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