2using System.Collections.Generic;
53 object M =
Arguments[0].AssociatedObjectValue;
54 string Object =
string.Empty;
55 string Actor =
string.Empty;
56 string EventId =
string.Empty;
57 string Facility =
string.Empty;
58 string Module =
string.Empty;
59 string StackTrace =
string.Empty;
61 List<KeyValuePair<string, object>> Tags =
null;
62 bool Detailed =
false;
64 if (!(M is
string Message))
66 if (M is Exception ex)
71 Object = ex is
IEventObject Obj2 && !
string.IsNullOrEmpty(s = Obj2.Object) ? s : Object;
72 Actor = ex is
IEventActor Act && !
string.IsNullOrEmpty(s = Act.Actor) ? s : Actor;
73 EventId = ex is
IEventId EvId && !
string.IsNullOrEmpty(s = EvId.EventId) ? s : EventId;
74 Level = ex is
IEventLevel Lvl && Lvl.Level.HasValue ? Lvl.Level.Value : Level;
75 Facility = ex is
IEventFacility EvFa && !
string.IsNullOrEmpty(s = EvFa.Facility) ? s : Facility;
76 Module = ex is
IEventModule Mod && !
string.IsNullOrEmpty(s = Mod.Module) ? s : ex.Source;
81 KeyValuePair<string, object>[] Tags3 = Tags2.Tags;
84 Tags =
new List<KeyValuePair<string, object>>();
92 Message = M?.ToString() ??
string.Empty;
96 Arguments[1].AssociatedObjectValue is IDictionary<string, IElement> Obj)
98 foreach (KeyValuePair<string, IElement> P
in Obj)
100 switch (P.Key.ToUpper())
103 Object = P.Value.AssociatedObjectValue?.ToString() ??
string.Empty;
107 Actor = P.Value.AssociatedObjectValue?.ToString() ??
string.Empty;
111 EventId = P.Value.AssociatedObjectValue?.ToString() ??
string.Empty;
115 Facility = P.Value.AssociatedObjectValue?.ToString() ??
string.Empty;
119 Module = P.Value.AssociatedObjectValue?.ToString() ??
string.Empty;
123 StackTrace = P.Value.AssociatedObjectValue?.ToString() ??
string.Empty;
127 if (P.Value.AssociatedObjectValue is
EventLevel L ||
128 Enum.TryParse(P.Value.AssociatedObjectValue?.ToString() ??
string.Empty, out L))
135 Tags =
new List<KeyValuePair<string, object>>();
137 Tags.Add(
new KeyValuePair<string, object>(P.Key, P.Value.AssociatedObjectValue));
143 Tags =
new List<KeyValuePair<string, object>>();
145 Tags.Add(
new KeyValuePair<string, object>(P.Key, P.Value.AssociatedObjectValue));
155 this.
DoLog(Message, Object, Actor, EventId, Level, Facility, Module, StackTrace,
156 Tags?.ToArray() ??
new KeyValuePair<string, object>[0]);
168 public abstract void DoLog(
string Message);
182 public abstract void DoLog(
string Message,
string Object,
string Actor,
string EventId,
EventLevel Level,
183 string Facility,
string Module,
string StackTrace, params KeyValuePair<string, object>[] Tags);
Static class managing the application event log. Applications and services log events on this static ...
static string CleanStackTrace(string StackTrace)
Cleans a Stack Trace string, removing entries from the asynchronous execution model,...
Class managing a script expression.
Abstract base class for log functions
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
LogFunction(ScriptNode Message, int Start, int Length, Expression Expression)
Abstract base class for log functions
LogFunction(ScriptNode Message, ScriptNode Tags, int Start, int Length, Expression Expression)
Abstract base class for log functions
override string[] DefaultArgumentNames
Default Argument names
abstract void DoLog(string Message)
Logs information to the event log.
abstract void DoLog(string Message, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, string StackTrace, params KeyValuePair< string, object >[] Tags)
Logs information to the event log.
Base class for multivariate funcions.
ScriptNode[] Arguments
Function arguments.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
Implement this interface on exception classes to allow the log to extract actor information in corres...
Implement this interface on exception classes to allow the log to extract facility information in cor...
Implement this interface on exception classes to allow the log to extract Event ID information in cor...
Implement this interface on exception classes to allow the log to extract Event Level information in ...
Implement this interface on exception classes to allow the log to extract module information in corre...
Implement this interface on exception classes to allow the log to extract object information in corre...
Basic interface for all types of elements.
ArgumentType
Type of parameter used in a function definition or a lambda definition.