Example #1
0
 /// <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);
         }
     }
 }
Example #3
0
 /// <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);    
         }
     }
 }
Example #4
0
 /// <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);
         }
     }
 }
Example #5
0
 /// <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);
         }
     }
 }
Example #6
0
 internal static extern void grpcsharp_redirect_log(GprLogDelegate callback);
Example #7
0
 void IPlatformInvocation.grpcsharp_redirect_log(GprLogDelegate callback)
 {
     grpcsharp_redirect_log(callback);
 }
Example #8
0
 static extern void grpcsharp_redirect_log(GprLogDelegate callback);
Example #9
0
 void IPlatformInvocation.grpcsharp_redirect_log(GprLogDelegate callback)
 {
     grpcsharp_redirect_log(callback);
 }