Debug: Use native logging on Android
This commit is contained in:
		
							parent
							
								
									a112529f53
								
							
						
					
					
						commit
						88c41bcc62
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
					@ -26,6 +26,11 @@
 | 
				
			||||||
#include <sstream>
 | 
					#include <sstream>
 | 
				
			||||||
#include <vector>
 | 
					#include <vector>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef __ANDROID__
 | 
				
			||||||
 | 
					#include <android/log.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* A cheap replacement for qDebug() */
 | 
					/* A cheap replacement for qDebug() */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Debug
 | 
					class Debug
 | 
				
			||||||
| 
						 | 
					@ -56,7 +61,11 @@ public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	~Debug()
 | 
						~Debug()
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
					#ifdef __ANDROID__
 | 
				
			||||||
 | 
							__android_log_write(ANDROID_LOG_DEBUG, "mkxp", buf.str().c_str());
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
		std::cerr << buf.str() << std::endl;
 | 
							std::cerr << buf.str() << std::endl;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue