using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Logging; using Tango.PMR.Debugging; using Tango.Telemetry.Telemetries; namespace Tango.Telemetry.Mappers { public class LogMapper { public static TelemetryLog MapLog(LogItemBase log) { TelemetryLog tLog = new TelemetryLog(); tLog.Source = "Application"; tLog.Time = DateTime.UtcNow; tLog.Category = log.Category.ToString(); tLog.Class = log.ClassName; tLog.Method = log.CallerMethodName; tLog.Line = log.CallerLineNumber; tLog.Message = log.Message; return tLog; } public static TelemetryLog MapLog(StartDebugLogResponse log) { TelemetryLog tLog = new TelemetryLog(); tLog.Source = "Firmware"; tLog.Time = DateTime.UtcNow; tLog.Category = log.Category.ToString(); tLog.Class = log.FileName; tLog.Method = $"[{log.ModuleId}] [{log.Filter}] [{log.Parameter}]"; tLog.Line = log.LineNumber; tLog.Message = log.Message; return tLog; } } }