IKVM11
11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
DiagnosticEventException.cs
Go to the documentation of this file.
1
using
System
;
2
3
namespace
IKVM.CoreLib.Diagnostics
4
{
5
6
sealed
class
DiagnosticEventException
: Exception
7
{
8
15
static
string
FormatDiagnosticLevel(
DiagnosticLevel
level)
16
{
17
return
level
switch
18
{
19
DiagnosticLevel.Trace =>
"trace"
,
20
DiagnosticLevel.Info =>
"info"
,
21
DiagnosticLevel.Warning =>
"warning"
,
22
DiagnosticLevel.Error =>
"error"
,
23
DiagnosticLevel.Fatal =>
"fatal"
,
24
_ =>
throw
new
InvalidOperationException(),
25
};
26
}
27
28
readonly
DiagnosticEvent
_event;
29
34
internal
DiagnosticEventException
(in
DiagnosticEvent
evt) :
35
#if NET8_0_OR_GREATER
36
base($
"{FormatDiagnosticLevel(evt.Diagnostic.Level)} IKVM{evt.Diagnostic.Id:D4}: {string.Format(null, evt.Diagnostic.Message, evt.Args)}"
)
37
#else
38
base($
"{FormatDiagnosticLevel(evt.Diagnostic.Level)} IKVM{evt.Diagnostic.Id:D4}: {string.Format(null, evt.Diagnostic.Message, evt.Args)}"
)
39
#endif
40
{
41
_event = evt;
42
}
43
47
public
DiagnosticEvent
Event
=> _event;
48
49
}
50
51
}
IKVM.CoreLib.Diagnostics.DiagnosticEventException
Definition
DiagnosticEventException.cs:7
IKVM.CoreLib.Diagnostics.DiagnosticEventException.Event
DiagnosticEvent Event
Gets the event that triggered this exception.
Definition
DiagnosticEventException.cs:47
IKVM.CoreLib.Diagnostics
Definition
Diagnostic.cs:4
IKVM.CoreLib.Diagnostics.DiagnosticLevel
DiagnosticLevel
Represents the level of security of a diagnostic event.
Definition
DiagnosticLevel.cs:7
System
Definition
HexConverter.cs:9
IKVM.CoreLib.Diagnostics.DiagnosticEvent
Definition
DiagnosticEvent.g.cs:9
src
IKVM.CoreLib
Diagnostics
DiagnosticEventException.cs
Generated by
1.12.0