Skip to content

Commit 41c50ec

Browse files
authored
Version 5.2.1 (#19)
1 parent 9f1da35 commit 41c50ec

File tree

3 files changed

+12
-44
lines changed

3 files changed

+12
-44
lines changed

README.md

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -73,38 +73,4 @@ Example `NLog.config`-file:
7373
</nlog>
7474
```
7575

76-
### Logging Unhandled Exceptions
77-
78-
The MAUI platform have failed to provide an unified way of tracking unhandled exceptions.
79-
80-
The normal way would be to hook into `AppDomain.CurrentDomain.UnhandledException`, but extra logic needed for iOS and Android:
81-
82-
Exceptions on iOS flows through AppDomain.CurrentDomain.UnhandledException, but one must set [UnwindNativeCode](https://github.com/xamarin/xamarin-macios/issues/15252):
83-
```csharp
84-
ObjCRuntime.Runtime.MarshalManagedException += (_, args) =>
85-
{
86-
args.ExceptionMode = ObjCRuntime.MarshalManagedExceptionMode.UnwindNativeCode;
87-
};
88-
```
89-
90-
Exceptions on Android only flows through `Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser`:
91-
```csharp
92-
Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
93-
{
94-
// Log unhandled args.Exception
95-
};
96-
```
97-
98-
NLog.Targets.MauiLog includes unified method to setup `UnhandledExceptionEventHandler`:
99-
```csharp
100-
NLog.LogManager.Setup().RegisterMauiLog((sender, ex) => {
101-
NLog.LogManager.GetLogger("Application").Fatal(ex, "Unhandled Exception");
102-
});
103-
```
104-
105-
One can also consider monitoring unobserved task exceptions:
106-
```csharp
107-
TaskScheduler.UnobservedTaskException += (sender, args) => {
108-
NLog.LogManager.GetLogger("Application").Error(args.Exception, "Unobserved Task Exception");
109-
};
110-
```
76+
See also [Logging Unhandled Exceptions](https://github.com/NLog/NLog.Targets.MauiLog/wiki/Logging-Unhandled-Exceptions)

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ artifacts:
1111
deploy:
1212
- provider: NuGet
1313
api_key:
14-
secure: e+0IpLU3V1eXUsWCRjKGuyyeuLQYfFpv6BAoIihFQryuYZsOWVvxUBvQOC0dOL2n
14+
secure: ACKSV1ixxNpO+2k8KvNDy6hd9QmR8lkQmKn773ZIIeVpG0ywYUhY4j8LcyykVR1a
1515
on:
1616
branch: master

src/NLog.Targets.MauiLog/NLog.Targets.MauiLog.csproj

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks Condition="'$(ContinuousIntegrationBuild)' != 'true'">netstandard2.0;net461</TargetFrameworks>
55
<TargetFrameworks Condition="'$(ContinuousIntegrationBuild)' == 'true'">netstandard2.0;Xamarin.iOS10;Xamarin.Mac20;MonoAndroid90;net6.0-ios;net6.0-macos;net6.0-android;net6.0-maccatalyst</TargetFrameworks>
6-
<VersionPrefix>5.2.0</VersionPrefix>
6+
<VersionPrefix>5.2.1</VersionPrefix>
77
<AssemblyVersion>5.0.0.0</AssemblyVersion>
88
<AppVeyorBuildNumber>$(APPVEYOR_BUILD_NUMBER)</AppVeyorBuildNumber>
99
<AppVeyorBuildNumber Condition="'$(AppVeyorBuildNumber)' == ''">0</AppVeyorBuildNumber>
@@ -18,9 +18,11 @@
1818
<PackageProjectUrl>https://github.com/NLog/NLog.Targets.MauiLog</PackageProjectUrl>
1919
<PackageIcon>N.png</PackageIcon>
2020
<PackageLicenseExpression>BSD-3-Clause</PackageLicenseExpression>
21+
<PackageReadmeFile>README.md</PackageReadmeFile>
2122
<PackageReleaseNotes>
22-
- Updated NLog v5.2
23-
- Introduced RegisterMauiLog() extension method for LogManager.Setup()
23+
- Added support for UnhandledExceptionEventHandler in RegisterMauiLog
24+
- Updated to NLog v5.2.2
25+
- Added nuget-package README.md
2426
</PackageReleaseNotes>
2527

2628
<IsPackable>true</IsPackable>
@@ -31,19 +33,19 @@
3133
<CheckEolWorkloads>false</CheckEolWorkloads>
3234
</PropertyGroup>
3335

34-
<Target Name="DownloadMissingContent" BeforeTargets="GenerateNuspec">
35-
<DownloadFile SourceUrl="https://nlog-project.org/N.png" DestinationFolder="$(MSBuildThisFileDirectory)" />
36-
</Target>
37-
3836
<ItemGroup>
3937
<EmbeddedResource Include="ILLink.Descriptors.xml">
4038
<LogicalName>ILLink.Descriptors.xml</LogicalName>
4139
</EmbeddedResource>
4240
</ItemGroup>
4341

4442
<ItemGroup>
43+
<None Include="../../README.md" Pack="true" PackagePath="" />
4544
<None Include="N.png" Pack="true" PackagePath="" Visible="false" />
4645
</ItemGroup>
46+
<Target Name="DownloadMissingContent" BeforeTargets="GenerateNuspec">
47+
<DownloadFile SourceUrl="https://nlog-project.org/N.png" DestinationFolder="$(MSBuildThisFileDirectory)" />
48+
</Target>
4749

4850
<PropertyGroup Condition=" '$(TargetFramework)' == 'MonoAndroid90' Or '$(TargetFramework)' == 'net6.0-android' ">
4951
<DefineConstants>$(DefineConstants);__ANDROID__</DefineConstants>
@@ -61,7 +63,7 @@
6163
</ItemGroup>
6264

6365
<ItemGroup>
64-
<PackageReference Include="NLog" Version="5.2.0" />
66+
<PackageReference Include="NLog" Version="5.2.2" />
6567
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
6668
</ItemGroup>
6769

0 commit comments

Comments
 (0)