-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrowserConsoleDiagnostics.cs
More file actions
36 lines (32 loc) · 1004 Bytes
/
BrowserConsoleDiagnostics.cs
File metadata and controls
36 lines (32 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
namespace DotPilot;
internal static partial class BrowserConsoleDiagnostics
{
internal static void Info(string message)
{
ArgumentException.ThrowIfNullOrWhiteSpace(message);
#if __WASM__
#pragma warning disable CA1416
JSImportMethods.Info(message);
#pragma warning restore CA1416
#endif
}
internal static void Error(string message)
{
ArgumentException.ThrowIfNullOrWhiteSpace(message);
#if __WASM__
#pragma warning disable CA1416
JSImportMethods.Error(message);
#pragma warning restore CA1416
#endif
}
#if __WASM__
[System.Runtime.Versioning.SupportedOSPlatform("browser")]
private static partial class JSImportMethods
{
[System.Runtime.InteropServices.JavaScript.JSImport("globalThis.console.info")]
internal static partial void Info(string message);
[System.Runtime.InteropServices.JavaScript.JSImport("globalThis.console.error")]
internal static partial void Error(string message);
}
#endif
}