fixup compile error in log_android.c

compilation errors introduced in the following commit.

commit 0cd69562fd
Author: ctiller <ctiller@google.com>
Date:   Fri Jan 9 14:22:10 2015 -0800

    Allow logging mechanism to be overridden by applications.

    This necessitated the removal of gpr_vlog to keep a clean interface.
        Change on 2015/01/09 by ctiller <ctiller@google.com>
    -------------
    Created by MOE: http://code.google.com/p/moe-java
    MOE_MIGRATED_REVID=83634996

Errors are:

grpc/src/core/support/log_android.c:75:20: error: 'file' undeclared (first use in this function)
     display_file = file;
                    ^
grpc/src/core/support/log_android.c:75:20: note: each undeclared identifier is reported only once for each function it appears in
grpc/src/core/support/log_android.c:79:13: error: 'prefix' undeclared (first use in this function)
   asprintf(&prefix, "%s:%d] %s", display_file, args->line, args->message);
             ^
grpc/src/core/support/log_android.c:85:8: error: 'suffix' undeclared (first use in this function)
   free(suffix);
        ^
pull/250/head
Todd Poynor 10 years ago
parent 768fd511a4
commit cb7abfd662
  1. 6
      src/core/support/log_android.c

@ -72,17 +72,15 @@ void gpr_default_log(gpr_log_func_args *args) {
final_slash = strrchr(args->file, '/');
if (final_slash == NULL)
display_file = file;
display_file = args->file;
else
display_file = final_slash + 1;
asprintf(&prefix, "%s:%d] %s", display_file, args->line, args->message);
asprintf(&output, "%s:%d] %s", display_file, args->line, args->message);
__android_log_write(severity_to_log_priority(args->severity), "GRPC", output);
/* allocated by asprintf => use free, not gpr_free */
free(prefix);
free(suffix);
free(output);
}

Loading…
Cancel
Save