aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2015-07-24 00:28:16 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2015-07-24 15:20:23 -0700
commit0526161385677fdd8a27dd21611c3e9721d9fc90 (patch)
treedcd37f280308869378573af69d123b108865d41b /src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
parent01cd209078029fc2d070e5982474c930ed864997 (diff)
introduce gRPC logger
Diffstat (limited to 'src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs')
-rw-r--r--src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
index b77e893044..cb4c7c821e 100644
--- a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
+++ b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
@@ -36,7 +36,7 @@ using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
-using Grpc.Core.Internal;
+using Grpc.Core.Logging;
namespace Grpc.Core.Internal
{
@@ -45,6 +45,8 @@ namespace Grpc.Core.Internal
/// </summary>
internal class GrpcThreadPool
{
+ static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<GrpcThreadPool>();
+
readonly GrpcEnvironment environment;
readonly object myLock = new object();
readonly List<Thread> threads = new List<Thread>();
@@ -82,7 +84,7 @@ namespace Grpc.Core.Internal
{
cq.Shutdown();
- Console.WriteLine("Waiting for GRPC threads to finish.");
+ Logger.Info("Waiting for GRPC threads to finish.");
foreach (var thread in threads)
{
thread.Join();
@@ -129,12 +131,12 @@ namespace Grpc.Core.Internal
}
catch (Exception e)
{
- Console.WriteLine("Exception occured while invoking completion delegate: " + e);
+ Logger.Error(e, "Exception occured while invoking completion delegate");
}
}
}
while (ev.type != GRPCCompletionType.Shutdown);
- Console.WriteLine("Completion queue has shutdown successfully, thread " + Thread.CurrentThread.Name + " exiting.");
+ Logger.Info("Completion queue has shutdown successfully, thread {0} exiting.", Thread.CurrentThread.Name);
}
}
}