Esempio n. 1
0
        void ILog.Write(LogLevel logLevel, string message)
        {
            var now      = _dateTimeProvider.Now;
            var logEntry = LogEntryFactory.Create(_name, now, message, logLevel);

            _logWriter.Write(logEntry);
        }
Esempio n. 2
0
 internal void Write(Log log, LogLevel logLevel, string message)
 {
     if (_multipeLog != null)
     {
         var logEntry = LogEntryFactory.Create(log.LoggedName, _dateTimeProvider.Now, message, logLevel);
         _multipeLog.Write(logEntry);
     }
 }
Esempio n. 3
0
        public void Create_SendInSeverity_ReturnsEntryWithCorrectSeverity()
        {
            var factory = new LogEntryFactory("Any name");

            var result = factory.Create(TraceEventType.Error, "Any message");

            Assert.AreEqual(TraceEventType.Error, result.Severity);
        }
Esempio n. 4
0
        public void Create_SendInObject_ReturnsEntryWithCorrectMessage()
        {
            var factory = new LogEntryFactory("Any name");

            var result = factory.Create(TraceEventType.Error, 1);

            Assert.AreEqual("1", result.Message);
        }
Esempio n. 5
0
        public void Create_CreateFactoryWithName_ReturnsEntryWithTitleSetToLoggerName()
        {
            var factory = new LogEntryFactory("Any name");

            var result = factory.Create(TraceEventType.Error, "Any message");

            Assert.AreEqual("Any name", result.Title);
        }
Esempio n. 6
0
 internal void Write(Log log, LogLevel logLevel, string format, params object[] args)
 {
     if (_multipeLog != null)
     {
         var message  = string.Format(format, args);
         var logEntry = LogEntryFactory.Create(log.LoggedName, _dateTimeProvider.Now, message, logLevel);
         _multipeLog.Write(logEntry);
     }
 }