Skip to content

Instantly share code, notes, and snippets.

@mauiaaron
Created October 22, 2013 17:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauiaaron/7105043 to your computer and use it in GitHub Desktop.
Save mauiaaron/7105043 to your computer and use it in GitHub Desktop.
Workaround Android log limit
/*
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