示例#1
0
 public FileLogger(
     ILogEntryFormatter logEntryFormatter,
     ILoggerSettingsRepository loggerSettingsRepository
     )
 {
     _logEntryFormatter        = logEntryFormatter;
     _loggerSettingsRepository = loggerSettingsRepository;
 }
示例#2
0
        public FileLogger(
            ILogEntryFormatter logEntryFormatter,
            ILoggerSettingsRepository loggerSettingsRepository
            ) : base(logEntryFormatter)
        {
            Settings = loggerSettingsRepository.Get();

            lock (lockObj)
            {
                using (var streamWriter = new StreamWriter(GetFilePath(), false))
                {
                    streamWriter.WriteLine(string.Empty);
                    streamWriter.Close();
                }
            }
        }