1 /*
2  *  Created by Martin on 29/08/2017.
3  *
4  *  Distributed under the Boost Software License, Version 1.0. (See accompanying
5  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6  *
7  */
8 
9 #include "catch_debug_console.h"
10 #include "catch_compiler_capabilities.h"
11 #include "catch_stream.h"
12 #include "catch_platform.h"
13 #include "catch_windows_h_proxy.h"
14 
15 #if defined(CATCH_CONFIG_ANDROID_LOGWRITE)
16 #include <android/log.h>
17 
18     namespace Catch {
writeToDebugConsole(std::string const & text)19         void writeToDebugConsole( std::string const& text ) {
20             __android_log_write( ANDROID_LOG_DEBUG, "Catch", text.c_str() );
21         }
22     }
23 
24 #elif defined(CATCH_PLATFORM_WINDOWS)
25 
26     namespace Catch {
writeToDebugConsole(std::string const & text)27         void writeToDebugConsole( std::string const& text ) {
28             ::OutputDebugStringA( text.c_str() );
29         }
30     }
31 
32 #else
33 
34     namespace Catch {
writeToDebugConsole(std::string const & text)35         void writeToDebugConsole( std::string const& text ) {
36             // !TBD: Need a version for Mac/ XCode and other IDEs
37             Catch::cout() << text;
38         }
39     }
40 
41 #endif // Platform
42