|
|
@ -36,12 +36,13 @@ |
|
|
|
#ifdef GPR_WIN32 |
|
|
|
#ifdef GPR_WIN32 |
|
|
|
|
|
|
|
|
|
|
|
#include <grpc/support/log.h> |
|
|
|
#include <grpc/support/log.h> |
|
|
|
|
|
|
|
#include <grpc/support/alloc.h> |
|
|
|
#include <stdio.h> |
|
|
|
#include <stdio.h> |
|
|
|
#include <stdarg.h> |
|
|
|
#include <stdarg.h> |
|
|
|
|
|
|
|
|
|
|
|
void gpr_log(const char *file, int line, gpr_log_severity severity, |
|
|
|
void gpr_log(const char *file, int line, gpr_log_severity severity, |
|
|
|
const char *message) { |
|
|
|
const char *format, ...) { |
|
|
|
const char *message = NULL; |
|
|
|
char *message = NULL; |
|
|
|
va_list args; |
|
|
|
va_list args; |
|
|
|
int ret; |
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
|
@ -53,7 +54,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, |
|
|
|
message = NULL; |
|
|
|
message = NULL; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
/* Allocate a new buffer, with space for the NUL terminator. */ |
|
|
|
/* Allocate a new buffer, with space for the NUL terminator. */ |
|
|
|
strp_buflen = (size_t)ret + 1; |
|
|
|
size_t strp_buflen = (size_t)ret + 1; |
|
|
|
message = gpr_malloc(strp_buflen); |
|
|
|
message = gpr_malloc(strp_buflen); |
|
|
|
|
|
|
|
|
|
|
|
/* Print to the buffer. */ |
|
|
|
/* Print to the buffer. */ |
|
|
@ -73,7 +74,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, |
|
|
|
|
|
|
|
|
|
|
|
/* Simple starter implementation */ |
|
|
|
/* Simple starter implementation */ |
|
|
|
void gpr_default_log(gpr_log_func_args *args) { |
|
|
|
void gpr_default_log(gpr_log_func_args *args) { |
|
|
|
fprintf(stderr, "%s %s:%d: %s\n", gpr_log_severity_string(severity), |
|
|
|
fprintf(stderr, "%s %s:%d: %s\n", gpr_log_severity_string(args->severity), |
|
|
|
args->file, args->line, args->message); |
|
|
|
args->file, args->line, args->message); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|