Commit 3059ef094d98c7707bed2a69a74ceca90cb9ebdd

Authored by perry.werneck@gmail.com
1 parent 97afce9c

Android - Ajustes após a redução da lib, remoção de traces e logs

Showing 2 changed files with 12 additions and 0 deletions   Show diff stats
src/lib3270/screen.c
@@ -613,7 +613,13 @@ void show_3270_popup_dialog(H3270 *session, LIB3270_NOTIFY type, const char *tit @@ -613,7 +613,13 @@ void show_3270_popup_dialog(H3270 *session, LIB3270_NOTIFY type, const char *tit
613 613
614 static int logpopup(H3270 *session, void *widget, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg) 614 static int logpopup(H3270 *session, void *widget, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg)
615 { 615 {
  616 +#ifdef ANDROID
  617 + char *mask = xs_buffer("%s\n",fmt);
  618 + __android_log_vprint(ANDROID_LOG_VERBOSE, PACKAGE_NAME, mask, arg);
  619 + lib3270_free(mask);
  620 +#else
616 lib3270_write_va_log(session,"lib3270",fmt,arg); 621 lib3270_write_va_log(session,"lib3270",fmt,arg);
  622 +#endif // ANDROID
617 return 0; 623 return 0;
618 } 624 }
619 625
src/lib3270/session.c
@@ -131,9 +131,15 @@ static void set_cursor(H3270 *session, LIB3270_CURSOR id) @@ -131,9 +131,15 @@ static void set_cursor(H3270 *session, LIB3270_CURSOR id)
131 131
132 static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *msg, const char *text) 132 static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *msg, const char *text)
133 { 133 {
  134 +#ifdef ANDROID
  135 + __android_log_print(ANDROID_LOG_VERBOSE, PACKAGE_NAME, "%s\n",title);
  136 + __android_log_print(ANDROID_LOG_VERBOSE, PACKAGE_NAME, "%s\n",msg);
  137 + __android_log_print(ANDROID_LOG_VERBOSE, PACKAGE_NAME, "%s\n",text);
  138 +#else
134 lib3270_write_log(session,"%s",title); 139 lib3270_write_log(session,"%s",title);
135 lib3270_write_log(session,"%s",msg); 140 lib3270_write_log(session,"%s",msg);
136 lib3270_write_log(session,"%s",text); 141 lib3270_write_log(session,"%s",text);
  142 +#endif // ANDROID
137 } 143 }
138 144
139 static void update_ssl(H3270 *session, LIB3270_SSL_STATE state) 145 static void update_ssl(H3270 *session, LIB3270_SSL_STATE state)