예제 #1
0
 private void WriteLogIfLogElementIsEnabled(Log log, LogElement logElement)
 {
     if (logElement.IsEnabled())
     {
         LogWriter.WriteLog(log, logElement);
     }
 }
예제 #2
0
 private void WriteLogIfLogElementIsEnabled(Log log, LogElement logElement)
 {
     if (logElement.IsEnabled())
     {
         LogWriter.WriteLog(log, logElement);
     }
 }
예제 #3
0
 private void WriteLogToFile(Log log, LogElement logElement)
 {
     StreamWriter fileDescriptor = File.AppendText(logElement.FilePath);
     string logLine = CreateLogLine(log);
     fileDescriptor.WriteLine(logLine);
     fileDescriptor.Close();
 }
예제 #4
0
        private void WriteLogToFile(Log log, LogElement logElement)
        {
            StreamWriter fileDescriptor = File.AppendText(logElement.FilePath);
            string       logLine        = CreateLogLine(log);

            fileDescriptor.WriteLine(logLine);
            fileDescriptor.Close();
        }
예제 #5
0
        /**
         * @see FileWriter
         */
        public void WriteLog(Log log, LogElement logElement)
        {
            if (EventLogSourceDoesNotExist())
            {
                CreateEventLogSourceForLevel(log.Level);
            }

            WriteLogToEventLog(log);
        }
 private void LoadLogElementIntoLogLevelFiles(LogElement log)
 {
     ArrayList logs;
     if (!LogLevelFiles.TryGetValue(log.Level, out logs))
     {
         logs = new ArrayList();
         LogLevelFiles.Add(log.Level, logs);
     }
     logs.Add(log);
 }
예제 #7
0
        private void LoadLogElementIntoLogLevelFiles(LogElement log)
        {
            ArrayList logs;

            if (!LogLevelFiles.TryGetValue(log.Level, out logs))
            {
                logs = new ArrayList();
                LogLevelFiles.Add(log.Level, logs);
            }
            logs.Add(log);
        }
예제 #8
0
 /**
  * @see FileWriter
  */
 public void WriteLog(Log log, LogElement logElement)
 {
     try
     {
         if (!File.Exists(logElement.FilePath))
         {
             File.Create(logElement.FilePath);
         }
         WriteLogToFile(log, logElement);
     }
     catch (IOException)
     {
         throw new WritingException(logElement.FilePath);
     }
 }
예제 #9
0
 /**
  * @see FileWriter
  */
 public void WriteLog(Log log, LogElement logElement)
 {
     try
     {
         if (!File.Exists(logElement.FilePath))
         {
             File.Create(logElement.FilePath);
         }
         WriteLogToFile(log, logElement);
     }
     catch (IOException)
     {
         throw new WritingException(logElement.FilePath);
     }
 }