Created
          October 22, 2013 17:57 
        
      - 
      
- 
        Save mauiaaron/7105043 to your computer and use it in GitHub Desktop. 
    Workaround Android log limit
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* | |
| Yes, 1024 is an internal limit of __android_log_print / __android_log_vprint functions which printf() uses. See https://github.com/android/platform_system_core/blob/master/liblog/logd_write.c | |
| As a workaround I can suggest using custom printf function: | |
| */ | |
| #include <android/log.h> | |
| void uprintf(const char* format, ...) { | |
| va_list args; | |
| va_start(args, format); | |
| char* message = NULL; | |
| int result = vasprintf(&message, format, args); | |
| va_end(args); | |
| if (result != -1) | |
| { | |
| __android_log_write(ANDROID_LOG_DEBUG, "uprintf", message); | |
| free(message); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment