mirror of
https://github.com/wagesj45/CapyKit.git
synced 2024-11-13 19:53:36 -06:00
2.1 KiB
2.1 KiB
EmitEvent Method
Emits an event with the given severity level, message, and method name.
Definition
Namespace: CapyKit
Assembly: CapyKit (in CapyKit.dll) Version: 1.0.2
C#
public static void EmitEvent(
EventLevel eventLevel,
string message,
string method = null,
params Object[] args
)
F#
static member EmitEvent :
eventLevel : EventLevel *
message : string *
?method : string *
args : Object[]
(* Defaults:
let _method = defaultArg method null
*)
-> unit
Parameters
- EventLevel
- The severity level of the event.
- String
- The message describing the reason for the event. String formatting for args is accepted.
- String (Optional)
- (Optional) The name of the method where the event was raised.
- Object[]
- A variable-length parameters list containing arguments for formatting the message.
Remarks
In order to allow for efficient calling member access via CallerMemberNameAttribute , it is suggested that args is defined explicitly for formatted messages.
Example
C#
CapyEventReporter.EmitEvent(EventLevel.Error, "Could not find the description for {0}.", args: new[] { enumeration });
See Also
Reference
CapyEventReporter Class
CapyKit Namespace
CallerMemberNameAttribute