Пример #1
0
 private void InitializeDefinitions(string jsonUri)
 {
     if (!FilesystemIoHelper.FileExists(jsonUri))
     {
         throw new FileNotFoundException("can't access definition file: " + jsonUri, jsonUri);
     }
     this.ReadJsonDefinitions(FilesystemIoHelper.GetStreamReader(jsonUri));
 }
Пример #2
0
        private void InitializeFileSteam()
        {
            this.CheckConfigurationIsValid();

            if (!FilesystemIoHelper.FileExists(this.Logfile))
            {
                var message = "The specified logfile " + this.Logfile + " was not found";
                throw new FileNotFoundException(message, this.Logfile);
            }
            this.streamreader = FilesystemIoHelper.GetStreamReader(this.Logfile);
        }
Пример #3
0
        /// <summary>
        /// Creates a HTML report for a given set of <paramref name="events"/>.
        /// </summary>
        /// <param name="events"><see cref="SortedSet{T}"/> of <see cref="LogEvent"/>s found in a logfile.</param>
        public void CreateReport(IEnumerable <LogEvent> events)
        {
            var streamWriter = FilesystemIoHelper.GetStreamWriter(this.FileName);

            htmlWriter = new HtmlTextWriter(streamWriter);

            this.WriteHead();

            this.WriteBeginTag("table", " border=1 width=100%");
            this.WriteTableHeader();

            foreach (var logEvent in events)
            {
                this.WriteTableRow(logEvent);
            }

            htmlWriter.WriteEndTag("table");
        }