Skip to content

Commit

Permalink
Added logging
Browse files Browse the repository at this point in the history
Update game data for 1.4.5
  • Loading branch information
josdemmers committed May 15, 2022
1 parent d4d7648 commit 3fe3c5d
Show file tree
Hide file tree
Showing 15 changed files with 209 additions and 73 deletions.
62 changes: 31 additions & 31 deletions NewWorldCompanion.Services/Data/CraftingRecipes.json
Original file line number Diff line number Diff line change
Expand Up @@ -57110,7 +57110,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -57607,7 +57607,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -58104,7 +58104,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -58601,7 +58601,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -59098,7 +59098,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -59453,7 +59453,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -59950,7 +59950,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -73298,7 +73298,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -73795,7 +73795,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -74292,7 +74292,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -74789,7 +74789,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -75144,7 +75144,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -87427,7 +87427,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -87924,7 +87924,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -88421,7 +88421,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -88918,7 +88918,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -89415,7 +89415,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -89912,7 +89912,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -90409,7 +90409,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -90906,7 +90906,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -91403,7 +91403,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -91900,7 +91900,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -92397,7 +92397,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -92894,7 +92894,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -93391,7 +93391,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -93888,7 +93888,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -94385,7 +94385,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -163965,7 +163965,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -164462,7 +164462,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -164959,7 +164959,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down Expand Up @@ -165456,7 +165456,7 @@
"OutputQty": 1,
"ItemID": "",
"SkipGrantItems": null,
"BaseGearScore": 550,
"BaseGearScore": 502,
"BaseTier": 5,
"ProceduralTierID1": "",
"ProceduralTierID2": "",
Expand Down
14 changes: 11 additions & 3 deletions NewWorldCompanion.Services/HttpClientHandler.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using NewWorldCompanion.Interfaces;
using Microsoft.Extensions.Logging;
using NewWorldCompanion.Interfaces;
using Prism.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

Expand All @@ -13,6 +15,7 @@ namespace NewWorldCompanion.Services
public class HttpClientHandler : IHttpClientHandler
{
private readonly IEventAggregator _eventAggregator;
private readonly ILogger _logger;

// HttpClient is intended to be instantiated once per application, rather than per-use.
static readonly HttpClient _client = new HttpClient();
Expand All @@ -21,11 +24,14 @@ public class HttpClientHandler : IHttpClientHandler

#region Constructor

public HttpClientHandler(IEventAggregator eventAggregator)
public HttpClientHandler(IEventAggregator eventAggregator, ILogger<HttpClientHandler> logger)
{
// Init IEventAggregator
_eventAggregator = eventAggregator;

// Init logger
_logger = logger;

// Config client
//_client.DefaultRequestHeaders.Clear();
//_client.DefaultRequestHeaders.Add("Cache-Control", "no-cache");
Expand Down Expand Up @@ -60,8 +66,10 @@ public async Task<string> GetRequest(string uri)
{
return await _client.GetStringAsync(uri);
}
catch (Exception)
catch (Exception ex)
{
_logger.LogError(ex, MethodBase.GetCurrentMethod()?.Name);

return string.Empty;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<PackageReference Include="Emgu.CV" Version="4.5.5.4823" />
<PackageReference Include="Emgu.CV.Bitmap" Version="4.5.5.4823" />
<PackageReference Include="GameOverlay.Net" Version="4.3.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
<PackageReference Include="Prism.Core" Version="8.1.97" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="TesserNet" Version="0.6.0" />
Expand Down
Loading

0 comments on commit 3fe3c5d

Please sign in to comment.