File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
src/Uno.Extensions.Logging Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -53,18 +53,24 @@ public static IHostBuilder UseLogging(
53
53
{
54
54
if ( ! context . IsRegistered ( nameof ( UseLogging ) ) )
55
55
{
56
- #if ! __WASM__
57
56
#if __IOS__
58
57
#pragma warning disable CA1416 // Validate platform compatibility: The net8.0 version is not used on older versions of OS
59
58
builder . AddProvider ( new global ::Uno . Extensions . Logging . OSLogLoggerProvider ( ) ) ;
60
59
#pragma warning restore CA1416 // Validate platform compatibility
61
60
#elif NET6_0_OR_GREATER || __SKIA__ // Console isn't supported on all Xamarin targets, so only adding for net8.0 and above
62
- builder . AddConsole ( ) ;
61
+
62
+ if ( OperatingSystem . IsBrowser ( ) )
63
+ {
64
+ #if ! __IOS__ && ! __ANDROID__ && ! __SKIA__ && ! __WINDOWS__ && ! DESKTOP1_0_OR_GREATER
65
+ builder . AddProvider ( new global ::Uno . Extensions . Logging . WebAssembly . WebAssemblyConsoleLoggerProvider ( ) ) ;
63
66
#endif
64
- builder . AddDebug ( ) ;
65
- #elif __WASM__
66
- builder . AddProvider ( new global ::Uno . Extensions . Logging . WebAssembly . WebAssemblyConsoleLoggerProvider ( ) ) ;
67
+ }
68
+ else
69
+ {
70
+ builder . AddConsole ( ) ;
71
+ }
67
72
#endif
73
+ builder . AddDebug ( ) ;
68
74
}
69
75
70
76
configure ? . Invoke ( context , builder ) ;
Original file line number Diff line number Diff line change 30
30
<ProjectReference Include =" ..\Uno.Extensions.Hosting\Uno.Extensions.Hosting.csproj" />
31
31
</ItemGroup >
32
32
33
- <ItemGroup Condition =" '$(IsBrowserWasm)'=='true'" >
33
+ <ItemGroup Condition =" '$(IsBrowserWasm)'=='true' or '$(TargetFramework)' == 'net8.0' " >
34
34
<PackageReference Include =" Uno.Extensions.Logging.WebAssembly.Console" />
35
35
</ItemGroup >
36
36
</Project >
You can’t perform that action at this time.
0 commit comments