Ejemplo 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);
        }
Ejemplo 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);
     }
 }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
     }
 }