public void Log <TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func <TState, Exception, string> formatter)
            {
                TestLogItem item = new TestLogItem()
                {
                    CategoryName = _categoryName,
                    EventId      = eventId,
                    LogLevel     = logLevel,
                    Message      = formatter(state, exception),
                    ScopeValues  = new List <object>()
                };

                ScopeProvider?.ForEachScope <TestLogItem>((obj, state) =>
                {
                    item.ScopeValues.Add(obj);
                }, item);
                _logContent.AddLogItem(item);
            }
Exemple #2
0
 internal void AddLogItem(TestLogItem logItem)
 {
     _logList.Add(logItem);
 }