コード例 #1
0
 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";
 }
コード例 #2
0
 public LoggerToFileDefault(ITextLoggerTextFormatter textLoggerTextFormatter)
     : base(new ExeLocationInfo(), new EnvironmentInfo(new FileVersionInfoProvider()), new EventWaitHandleWrapperProvider(), textLoggerTextFormatter, "applog")
 {
 }
コード例 #3
0
 public ConsoleAndFileLogger(ILoggerToFile loggerToFile, ITextLoggerTextFormatter textLoggerTextFormatter)
     : base(textLoggerTextFormatter)
 {
     _toFile = loggerToFile;
 }
コード例 #4
0
        // ReSharper disable once InconsistentNaming

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