Beispiel #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);
         }
     }
 }
Beispiel #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);    
         }
     }
 }
Beispiel #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);
         }
     }
 }
Beispiel #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);
         }
     }
 }
Beispiel #6
0
 internal static extern void grpcsharp_redirect_log(GprLogDelegate callback);
Beispiel #7
0
 void IPlatformInvocation.grpcsharp_redirect_log(GprLogDelegate callback)
 {
     grpcsharp_redirect_log(callback);
 }
Beispiel #8
0
 static extern void grpcsharp_redirect_log(GprLogDelegate callback);
Beispiel #9
0
 void IPlatformInvocation.grpcsharp_redirect_log(GprLogDelegate callback)
 {
     grpcsharp_redirect_log(callback);
 }