MCPcopy Create free account
hub / github.com/OneNoteDev/WebClipper / createSetContextEventAsJson

Function createSetContextEventAsJson

src/scripts/logging/logHelpers.ts:72–82  ·  view source on GitHub ↗
(key: Log.Context.Custom, value: string)

Source from the content-addressed store, hash-verified

70 }
71
72 export function createSetContextEventAsJson(key: Log.Context.Custom, value: string): { [key: string]: string } {
73 let baseEvent = new Log.Event.BaseEvent(Log.Event.Label.SetContextProperty);
74 let event = LogHelpers.createBaseEventAsJson(Log.Event.Category[baseEvent.getEventCategory()], baseEvent.getLabel());
75
76 let keyAsString = Log.Context.toString(key);
77 event[Log.PropertyName.Custom[Log.PropertyName.Custom.Key]] = keyAsString;
78
79 event[Log.PropertyName.Custom[Log.PropertyName.Custom.Value]] = value;
80
81 return event;
82 }
83
84 export function createFailureEventAsJson(label: Log.Failure.Label, failureType: Log.Failure.Type, failureInfo?: OneNoteApi.GenericError, id?: string): { [key: string]: string } {
85 let failureEvent: { [key: string]: string } = LogHelpers.createBaseEventAsJson(Log.Failure.category, Log.Failure.Label[label]);

Callers

nothing calls this directly

Calls 3

getEventCategoryMethod · 0.95
getLabelMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected