/// <summary> /// sends logs list to the server /// </summary> /// <param name="logs"></param> private void LogPackage(List <Log> logs) { var logsToSend = FilterPackage(logs); if (logsToSend.Count > 0) { FnLogClient.SendLogPackage(logs, _fnLogInitPackage.LogServer); } }
/// <summary> /// writes and or sends a log, depending on the TelemetryType /// </summary> /// <param name="t">LogType</param> /// <param name="title">title</param> /// <param name="description">description</param> public void Log(LogType t, string title, string description) { try { if (_fnLogInitPackage.Telemetry != TelemetryType.LogLocalOnly) { if (( t == LogType.CriticalError || t == LogType.Error || t == LogType.Warning) || _fnLogInitPackage.Telemetry == TelemetryType.LogLocalSendAll ) { _localLog.AddLog(t, title, description); FnLogClient.SendLog(new Log( _fnLogInitPackage.ProgramName, _fnLogInitPackage.ProgramVersion.ToString(), FnLogClientVersion.ToString(), _localLog.UUID.ToString(), title, description, ((int)t)) , _fnLogInitPackage.LogServer); } else { _localLog.AddLog(t, title, description); } } else { _localLog.AddLog(t, title, description); } } catch (Exception e) { _localLog.AddLog(LogType.Error, "SimpleLogSenderException", e.Message + e.StackTrace); } }