/// <summary> /// Redirects logs from native gRPC C core library to a general logger. /// </summary> public static void Redirect() { lock (staticLock) { if (writeCallback == null) { writeCallback = new GprLogDelegate(HandleWrite); grpcsharp_redirect_log(writeCallback); } } }
/// <summary> /// Redirects logs from native gRPC C core library to a general logger. /// </summary> public static void Redirect(NativeMethods native) { lock (staticLock) { if (writeCallback == null) { writeCallback = new GprLogDelegate(HandleWrite); native.grpcsharp_redirect_log(writeCallback); } } }
/// <summary> /// Redirects logs from native gRPC C core library to a general logger. /// </summary> public static void Redirect() { lock (staticLock) { if (writeCallback == null) { writeCallback = new GprLogDelegate(HandleWrite); pinvoke.grpcsharp_redirect_log(writeCallback); } } }
/// <summary> /// Sets text writer as destination for logs from native gRPC C core library. /// Only first invocation has effect. /// </summary> /// <param name="textWriter"></param> public static void RedirectNativeLogs(TextWriter textWriter) { lock (staticLock) { if (writeCallback == null) { writeCallback = new GprLogDelegate(HandleWrite); dest = textWriter; grpcsharp_redirect_log(writeCallback); } } }
internal static extern void grpcsharp_redirect_log(GprLogDelegate callback);
void IPlatformInvocation.grpcsharp_redirect_log(GprLogDelegate callback) { grpcsharp_redirect_log(callback); }
static extern void grpcsharp_redirect_log(GprLogDelegate callback);