Skip to content

Commit 07eaa40

Browse files
committed
Removed logging code
1 parent c424d8c commit 07eaa40

File tree

3 files changed

+13
-51
lines changed

3 files changed

+13
-51
lines changed

code/complete/GraphQL/GraphQL.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<ProjectReference Include="/Users/michaelstaib/local/hc-2/src/HotChocolate/AspNetCore/src/AspNetCore/HotChocolate.AspNetCore.csproj" />
16-
<ProjectReference Include="/Users/michaelstaib/local/hc-2/src/HotChocolate/Data/src/Data/HotChocolate.Data.csproj" />
17-
<ProjectReference Include="/Users/michaelstaib/local/hc-2/src/HotChocolate/PersistedQueries/src/PersistedQueries.FileSystem/HotChocolate.PersistedQueries.FileSystem.csproj" />
15+
<ProjectReference Include="/Users/michael/local/hc-2/src/HotChocolate/AspNetCore/src/AspNetCore/HotChocolate.AspNetCore.csproj" />
16+
<ProjectReference Include="/Users/michael/local/hc-2/src/HotChocolate/Data/src/Data/HotChocolate.Data.csproj" />
17+
<ProjectReference Include="/Users/michael/local/hc-2/src/HotChocolate/PersistedQueries/src/PersistedQueries.FileSystem/HotChocolate.PersistedQueries.FileSystem.csproj" />
18+
<PackageReference Include="HotChocolate.AspNetCore" Version="12.0.0-rc.3" />
19+
<PackageReference Include="HotChocolate.Data" Version="12.0.0-rc.3" />
20+
<PackageReference Include="HotChocolate.PersistedQueries.FileSystem" Version="12.0.0-rc.3" />
1821
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-preview.7.21378.4" />
1922
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0-preview.7.21378.4">
2023
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

code/complete/GraphQL/Program.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
using System.IO;
2-
using Microsoft.AspNetCore.Hosting;
3-
using Microsoft.Extensions.Hosting;
4-
using ConferencePlanner.GraphQL.Imports;
5-
using Microsoft.Extensions.Logging;
6-
using Microsoft.Extensions.Logging.Configuration;
7-
81
namespace ConferencePlanner.GraphQL
92
{
103
public class Program
@@ -16,16 +9,6 @@ public static void Main(string[] args)
169

1710
public static IHostBuilder CreateHostBuilder(string[] args) =>
1811
Host.CreateDefaultBuilder(args)
19-
.ConfigureLogging((hostingContext, logging) =>
20-
{
21-
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
22-
logging.AddConsole();
23-
logging.AddDebug();
24-
logging.AddEventSourceLogger();
25-
})
26-
.ConfigureWebHostDefaults(webBuilder =>
27-
{
28-
webBuilder.UseStartup<Startup>();
29-
});
12+
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());
3013
}
3114
}

code/complete/GraphQL/Startup.cs

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Threading.Tasks;
45
using Microsoft.AspNetCore.Builder;
56
using Microsoft.AspNetCore.Hosting;
67
using Microsoft.EntityFrameworkCore;
78
using Microsoft.Extensions.DependencyInjection;
89
using Microsoft.Extensions.Hosting;
10+
using Microsoft.Extensions.Logging;
911
using ConferencePlanner.GraphQL.Attendees;
1012
using ConferencePlanner.GraphQL.Data;
1113
using ConferencePlanner.GraphQL.DataLoader;
@@ -14,16 +16,15 @@
1416
using ConferencePlanner.GraphQL.Speakers;
1517
using ConferencePlanner.GraphQL.Tracks;
1618
using ConferencePlanner.GraphQL.Types;
19+
using GreenDonut;
1720
using HotChocolate;
18-
using HotChocolate.Types;
19-
using HotChocolate.Resolvers;
2021
using HotChocolate.AspNetCore;
21-
using System.Diagnostics;
22-
using GreenDonut;
2322
using HotChocolate.Execution;
2423
using HotChocolate.Execution.Instrumentation;
24+
using HotChocolate.Resolvers;
25+
using HotChocolate.Types;
2526
using HotChocolate.Types.Pagination;
26-
using Microsoft.Extensions.Logging;
27+
2728
using IActivityScope = GreenDonut.IActivityScope;
2829

2930
namespace ConferencePlanner.GraphQL
@@ -47,13 +48,9 @@ public void ConfigureServices(IServiceCollection services)
4748
(s, o) => o
4849
.UseSqlite("Data Source=conferences.db")
4950
.UseLoggerFactory(s.GetRequiredService<ILoggerFactory>()))
50-
51-
.AddSingleton<IDataLoaderDiagnosticEvents, DataLoaderDiagnostics>()
5251

5352
// This adds the GraphQL server core service and declares a schema.
5453
.AddGraphQLServer()
55-
56-
.AddDiagnosticEventListener<HotChocolateDiagnostics>()
5754

5855
// Next we add the types to our schema.
5956
.AddQueryType()
@@ -137,25 +134,4 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
137134
});
138135
}
139136
}
140-
141-
public class DataLoaderDiagnostics : DataLoaderDiagnosticEventListener
142-
{
143-
public override IActivityScope ExecuteBatch<TKey>(IDataLoader dataLoader, IReadOnlyList<TKey> keys)
144-
{
145-
Console.WriteLine($"{dataLoader.GetType().Name}:{keys.Count}");
146-
return EmptyScope;
147-
}
148-
}
149-
150-
public class HotChocolateDiagnostics : DiagnosticEventListener
151-
{
152-
public override HotChocolate.Execution.Instrumentation.IActivityScope ExecuteRequest(IRequestContext context)
153-
{
154-
Console.Clear();
155-
Console.WriteLine("REQUEST_START");
156-
Console.WriteLine();
157-
Console.WriteLine();
158-
return base.ExecuteRequest(context);
159-
}
160-
}
161137
}

0 commit comments

Comments
 (0)