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

Function addToLogEvent

src/scripts/logging/logHelpers.ts:133–152  ·  view source on GitHub ↗
(logEvent: { [key: string]: string | number | boolean }, properties?: {})

Source from the content-addressed store, hash-verified

131 }
132
133 export function addToLogEvent(logEvent: { [key: string]: string | number | boolean }, properties?: {}): void {
134 if (logEvent[Log.PropertyName.Reserved.Status] === Log.Status[Log.Status.Failed]) {
135 logEvent[Log.PropertyName.Reserved.StackTrace] = Log.Failure.getStackTrace();
136 }
137
138 if (properties) {
139 for (let name in properties) {
140 if (properties.hasOwnProperty(name)) {
141 let propValue: string;
142 if (typeof (properties[name]) === "object") {
143 propValue = JSON.stringify(properties[name]);
144 } else {
145 propValue = properties[name];
146 }
147
148 logEvent[name] = propValue;
149 }
150 }
151 }
152 }
153
154 export function isConsoleOutputEnabled(): boolean {
155 try {

Callers 1

createLogEventAsJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected