Пример #1
0
        public static void Report(
            string subject, string body, IEnumerable <string> attachmentPaths, LogLevel logLevel = LogLevel.Info)
        {
            var startTime = DateTimeOffset.Now;
            var logLabel  = $"Report #{++_logCounter}";

            LogService.Log($"{logLabel}: {subject}", logLevel);
            var targetDirectory = PathHelper.Combine(Kit.DiagnisticsCurrentDirectory, ReportsDirectory);

            foreach (var client in Clients)
            {
                try
                {
                    client.PushToReport(subject, body, attachmentPaths, targetDirectory);
                }
                catch (Exception reportException)
                {
                    Debug.Fail(reportException.ToString());
                    // no throw for report exception
                }
            }

            LogService.Log($"{logLabel} completed at {TimeHelper.FormattedLatency(startTime)}");
        }
Пример #2
0
 public static string NativePath(string path) =>
 PathHelper.Combine(Kit.BaseDirectory, Kit.WorkingDirectory, path);