Beispiel #1
0
        internal LogFileChecker(Cartographer cartographer, string filePath)
        {
            _cartographer = cartographer;
            _filePath     = filePath;

            // Generate regex
            _fileExtension            = Path.GetExtension(_filePath);
            _fileNameWithoutExtension = Path.GetFileNameWithoutExtension(_filePath);
            _regexFilter = new Regex($@"({_fileNameWithoutExtension})\.\d+({_fileExtension})");
        }
Beispiel #2
0
        public Printer(Cartographer cartographer, BlockingCollection <LogMessage> loggerQueue, string filePath)
        {
            _filePath       = filePath;
            _loggerQueue    = loggerQueue;
            _cartographer   = cartographer;
            _logFileChecker = new LogFileChecker(cartographer, filePath);

            _logWriter = new StreamWriter(filePath, true)
            {
                AutoFlush = true
            };
        }