public LoggerToFile(IExeLocationInfo exeLocationInfo,
                     IEnvironmentInfo environmentInfo,
                     IEventWaitHandleWrapperProvider eventWaitHandleWrapperProvider,
                     ITextLoggerTextFormatter textLoggerTextFormatter, string applicationLogDirectoryName)
 {
     _exeLocationInfo = exeLocationInfo;
     _environmentInfo = environmentInfo;
     _eventWaitHandleWrapperProvider = eventWaitHandleWrapperProvider;
     _textFormatter = textLoggerTextFormatter;
     if (string.IsNullOrEmpty(applicationLogDirectoryName))
     {
         throw new ArgumentNullException($"Argument by name:{nameof(applicationLogDirectoryName)} should not be null or empty");
     }
     _applicationLogDirectoryName = applicationLogDirectoryName;
     _logFileName = Path.GetFileNameWithoutExtension(_exeLocationInfo.ExeFullPath) + "_Log.txt";
 }
Exemple #2
0
 public LoggerToFileDefault(ITextLoggerTextFormatter textLoggerTextFormatter)
     : base(new ExeLocationInfo(), new EnvironmentInfo(new FileVersionInfoProvider()), new EventWaitHandleWrapperProvider(), textLoggerTextFormatter, "applog")
 {
 }
 public ConsoleAndFileLogger(ILoggerToFile loggerToFile, ITextLoggerTextFormatter textLoggerTextFormatter)
     : base(textLoggerTextFormatter)
 {
     _toFile = loggerToFile;
 }
Exemple #4
0
        // ReSharper disable once InconsistentNaming

        public ConsoleLogger(ITextLoggerTextFormatter textLoggerTextFormatter)
        {
            TextLoggerTextFormatter = textLoggerTextFormatter;
        }