예제 #1
0
        protected SimpleLogItem LogItem(SimpleLogItemSeverity severity, String message, String description = null, Exception exception = null)
        {
            SimpleLogItem item = CreateItem(severity, message, description, exception);

            Log.Add(item);

            return(item);
        }
예제 #2
0
        private void WriteFooter()
        {
            var status   = string.Join(", ", _replayList.Select(s => $"{s.Value.Count} {s.Key}(s)"));
            var logLevel = _replayList.FirstOrDefault(s => s.Value.Count > 0).Key;
            var header   = $"\n\nThere are totally {status}";
            var logItem  = new SimpleLogItem(logLevel, header, "Build Completed.");

            foreach (var listener in _listeners)
            {
                listener.WriteLine(logItem);
            }
        }
예제 #3
0
파일: FormLog.cs 프로젝트: zon/triangle
        private ListViewItem CreateListViewItem(SimpleLogItem item)
        {
            ListViewItem lvi = new ListViewItem(new string[] { item.Message, item.Info });

            if (item.Level == LogLevel.Error)
            {
                lvi.ForeColor = Color.DarkRed;
            }
            else if (item.Level == LogLevel.Warning)
            {
                lvi.ForeColor = Color.Peru;
            }
            else
            {
                lvi.ForeColor = Color.Black;
            }

            lvi.UseItemStyleForSubItems = true;

            return(lvi);
        }
예제 #4
0
        private void WriteHeader()
        {
            var    logLevel = _replayList.FirstOrDefault(s => s.Value.Count > 0).Key;
            string message;

            if (logLevel >= LogLevel.Error)
            {
                message = "Build failed.";
            }
            else if (logLevel == LogLevel.Warning)
            {
                message = "Build succeeded with warning.";
            }
            else
            {
                message = "Build succeeded.";
            }
            var logItem = new SimpleLogItem(logLevel, $"\n\n{message}", null);

            foreach (var listener in _listeners)
            {
                listener.WriteLine(logItem);
            }
        }
예제 #5
0
 private void WriteFooter()
 {
     var status = string.Join(", ", _replayList.Select(s => $"{s.Value.Count} {s.Key}(s)"));
     var logLevel = _replayList.FirstOrDefault(s => s.Value.Count > 0).Key;
     var header = $"\n\nThere are totally {status}";
     var logItem = new SimpleLogItem(logLevel, header, "Build Completed.");
     foreach (var listener in _listeners)
     {
         listener.WriteLine(logItem);
     }
 }
예제 #6
0
 private void WriteHeader()
 {
     var logLevel = _replayList.FirstOrDefault(s => s.Value.Count > 0).Key;
     string message;
     if (logLevel >= LogLevel.Error)
     {
         message = "Build failed.";
     }
     else if (logLevel == LogLevel.Warning)
     {
         message = "Build succeeded with warning.";
     }
     else
     {
         message = "Build succeeded.";
     }
     var logItem = new SimpleLogItem(logLevel, $"\n\n{message}", null);
     foreach (var listener in _listeners)
     {
         listener.WriteLine(logItem);
     }
 }