Exemple #1
0
 /// <summary>
 /// Writes a record using the output formatter if there is one.
 /// </summary>
 /// <param name="record">the record to write</param>
 private void WriteRecord(T record)
 {
     if (_logger.IsTraceEnabled)
     {
         _logger.Trace("Writing record: {0}", ObjectUtils.Dump(record));
     }
     _outputFile.Write(record);
 }
        public void Save(string path, IOutputFile outputFile)
        {
            string dir = Path.GetDirectoryName(path);

            if (dir != "" && !Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            using (FileStream stream = new FileStream(path, FileMode.Create))
            {
                outputFile.Write(stream);
            }
        }