Skip to content

Commit

Permalink
Merge pull request #7 from MindscapeHQ/ph/dependency-bump
Browse files Browse the repository at this point in the history
Dependency bump on Raygun4Net
  • Loading branch information
phillip-haydon committed Nov 15, 2023
2 parents 0b136a0 + 7c3232c commit 2b67d53
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 81 deletions.
3 changes: 3 additions & 0 deletions CHANGE-LOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Full Change Log for Raygun4Maui package

### v1.4.0
- Dependency update to Raygun4Net 8.0.0

### v1.3.0
- Dependency update to Raygun4Net 7.1.0
2 changes: 1 addition & 1 deletion Raygun.MAUI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
CHANGE-LOG.md = CHANGE-LOG.md
LICENSE = LICENSE
README.md = README.md
CHANGE-LOG.md = CHANGE-LOG.md
EndProjectSection
EndProject
Global
Expand Down
7 changes: 7 additions & 0 deletions Raygun4Maui.SampleApp/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
Clicked="OnILoggerErrorClicked"
HorizontalOptions="Center"/>

<Button
Text="Send using Serilog"
SemanticProperties.Hint="Test sending a message using Serilog"
Clicked="OnSerilogClicked"
HorizontalOptions="Center"
/>

</VerticalStackLayout>
</ScrollView>

Expand Down
56 changes: 32 additions & 24 deletions Raygun4Maui.SampleApp/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
namespace Raygun4Maui.SampleApp;
using Serilog;

namespace Raygun4Maui.SampleApp;

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using Microsoft.Extensions.Options;
using Raygun4Maui.SampleApp.TestingLogic;
using TestingLogic;

public partial class MainPage : ContentPage
{
int count = 0;
int count = 0;

private readonly String _apiKey;

public MainPage()
{
InitializeComponent();
{
InitializeComponent();

var configuration = new ConfigurationBuilder()
.AddUserSecrets<MainPage>()
.Build();
.AddUserSecrets<MainPage>()
.Build();

_apiKey = configuration["apiKey"] ?? "";

Expand All @@ -29,24 +28,22 @@ public MainPage()
}
else
{
ApiKeyLabel.Text += "Not set! Please set it Right-Click on the project solution and selecting Manage User Secrets";
ApiKeyLabel.Text +=
"Not set! Please set it Right-Click on the project solution and selecting Manage User Secrets";
}
}

private void OnCounterClicked(object sender, EventArgs e)
{
count++;
private void OnCounterClicked(object sender, EventArgs e)
{
count++;

if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times";
CounterBtn.Text = $"Clicked {count} time{(count > 1 ? "s" : string.Empty)}";

SemanticScreenReader.Announce(CounterBtn.Text);
}
SemanticScreenReader.Announce(CounterBtn.Text);
}

private void OnManualExceptionClicked(object sender, EventArgs e)
{
private void OnManualExceptionClicked(object sender, EventArgs e)
{
ManualExceptionButton.Text += ".";

TestManualExceptionsSent testManualExceptionsSent = new(_apiKey);
Expand All @@ -65,10 +62,21 @@ private void OnILoggerErrorClicked(object sender, EventArgs e)
{
ILoggerButton.Text += ".";

ILogger logger = Handler.MauiContext.Services.GetService<ILogger<MainPage>>();
ILogger logger = Handler!.MauiContext!.Services.GetService<ILogger<MainPage>>();

TestLoggerErrorsSent testLoggerErrorsSent = new(_apiKey, logger);
testLoggerErrorsSent.RunAllTests();
}
}

private void OnSerilogClicked(object sender, EventArgs e)
{
try
{
throw new ApplicationException("Captured by Serilog I hope...");
}
catch (Exception ex)
{
Log.Logger.Error(ex, "Serilog error");
}
}
}
16 changes: 11 additions & 5 deletions Raygun4Maui.SampleApp/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Configuration;
using Serilog;

namespace Raygun4Maui.SampleApp;

Expand All @@ -7,21 +8,26 @@ public static class MauiProgram
public static MauiApp CreateMauiApp()
{
var configuration = new ConfigurationBuilder()
.AddUserSecrets<MainPage>()
.Build();
.AddUserSecrets<MainPage>()
.Build();

string apiKey = configuration["apiKey"] ?? "";
var apiKey = configuration["apiKey"] ?? "";

var builder = MauiApp.CreateBuilder();
//builder.Configuration.AddUserSecrets<MainPage>();

Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Raygun(apiKey)
.CreateLogger();

builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
}).AddRaygun4Maui(apiKey);
return builder.Build();
return builder.Build();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<application android:allowBackup="true" android:supportsRtl="true" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
7 changes: 4 additions & 3 deletions Raygun4Maui.SampleApp/Raygun4Maui.SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Raygun" Version="7.3.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Raygun4Maui\Raygun4Maui.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Raygun4Maui\Raygun4Maui.csproj" />
</ItemGroup>

</Project>
7 changes: 1 addition & 6 deletions Raygun4Maui.SampleApp/TestingLogic/TestLoggerErrorsSent.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls;
using Raygun4Maui;

using Microsoft.Extensions.Logging;

namespace Raygun4Maui.SampleApp.TestingLogic
{
Expand Down Expand Up @@ -63,7 +59,6 @@ private void TestLogException()
{
_logger.Log(LogLevel.Error, e, "TestLogException exception caught at {Timestamp}", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"));
}

}

private static void TestLofExceptionInnerMethod()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Raygun4Maui;

namespace Raygun4Maui.SampleApp.TestingLogic
namespace Raygun4Maui.SampleApp.TestingLogic
{
internal class TestUnhandledExceptionsSent
{
Expand Down
2 changes: 1 addition & 1 deletion Raygun4Maui.Test/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<application android:allowBackup="true" android:supportsRtl="true" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
72 changes: 36 additions & 36 deletions Raygun4Maui/Raygun4Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>1.3.0</Version>
<PackageVersion>1.3.0</PackageVersion>
<Version>1.4.0</Version>
<PackageVersion>1.4.0</PackageVersion>
<Authors>Raygun</Authors>
<Company>Raygun</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down Expand Up @@ -46,73 +46,73 @@ The new information collected is as follows:
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-android|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-android|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-ios|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-ios|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-maccatalyst|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-maccatalyst|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-windows10.0.19041.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-windows10.0.19041.0|AnyCPU'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<ApplicationTitle>Raygun Crash Reporting Provider for .NET MAUI</ApplicationTitle>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\Raygun-icon-128x128.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\Raygun-icon-128x128.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Mindscape.Raygun4Net.NetCore" Version="7.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Mindscape.Raygun4Net.NetCore" Version="8.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "6.0.0",
"rollForward": "latestMajor",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}

0 comments on commit 2b67d53

Please sign in to comment.