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

            _logWriter.Write(logEntry);
        }
示例#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);
     }
 }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
     }
 }