void ILog.Write(LogLevel logLevel, string message) { var now = _dateTimeProvider.Now; var logEntry = LogEntryFactory.Create(_name, now, message, logLevel); _logWriter.Write(logEntry); }
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); } }
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); }
public void Create_SendInObject_ReturnsEntryWithCorrectMessage() { var factory = new LogEntryFactory("Any name"); var result = factory.Create(TraceEventType.Error, 1); Assert.AreEqual("1", result.Message); }
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); }
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); } }