public void RecordEvent(string eventName, object parameters = null) {
            using (StreamWriter sw = File.AppendText(FileTelemetryRecorder.TestLog)) {
                SimpleTelemetryEvent telemetryEvent = new SimpleTelemetryEvent(eventName);
                telemetryEvent.Properties = DictionaryExtension.FromAnonymousObject(parameters);

                string json = JsonConvert.SerializeObject(telemetryEvent);
                sw.WriteLine(json);
            }
        }
Example #2
0
        public void RecordEvent(string eventName, object parameters = null)
        {
            using (StreamWriter sw = File.AppendText(FileTelemetryRecorder.TestLog)) {
                SimpleTelemetryEvent telemetryEvent = new SimpleTelemetryEvent(eventName);
                telemetryEvent.Properties = DictionaryExtensions.FromAnonymousObject(parameters);

                string json = JsonConvert.SerializeObject(telemetryEvent);
                sw.WriteLine(json);
            }
        }