Ejemplo n.º 1
0
        public void Log <TState>(
            LogLevel logLevel,
            EventId eventId,
            TState state,
            Exception exception,
            Func <TState, Exception, string> formatter)
        {
            var msg        = LogDtoConverter.Convert(logLevel, eventId, state, exception, formatter);
            var msgToWrite = new LogMessageToWrite(msg, logLevel);

            _logMessageQueue.Push(msgToWrite);
        }
Ejemplo n.º 2
0
        public void Log <TState>(
            LogLevel logLevel,
            EventId eventId,
            TState state,
            Exception exception,
            Func <TState, Exception, string> formatter)
        {
            var msg        = LogDtoConverter.Convert(logLevel, eventId, state, exception, formatter);
            var msgToWrite = new LogMessageToWrite(msg, logLevel);
            var writeTask  = _logMessageWriter.WriteMessageAsync(Enumerable.Repeat(msgToWrite, 1), CancellationToken.None);

            writeTask.Wait(CancellationToken.None);
        }