Reacting to ILogger api changes

This commit is contained in:
Kiran Challa 2015-04-04 00:34:07 -07:00
parent c2c374014a
commit bd1e282e58
4 changed files with 14 additions and 6 deletions

View File

@ -57,7 +57,7 @@ namespace Microsoft.AspNet.Diagnostics.Elm
return _options.Filter(_name, logLevel);
}
public IDisposable BeginScope(object state)
public IDisposable BeginScopeImpl(object state)
{
var scope = new ElmScope(_name, state);
scope.Context = ElmScope.Current?.Context ?? GetNewActivityContext();

View File

@ -62,7 +62,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity
return true;
}
public virtual IDisposable BeginScope(object state)
public virtual IDisposable BeginScopeImpl(object state)
{
return NullScope.Instance;
}

View File

@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.Helpers
return true;
}
public IDisposable BeginScope(object state)
public IDisposable BeginScopeImpl(object state)
{
return NullScope.Instance;
}

View File

@ -179,9 +179,15 @@ namespace Microsoft.AspNet.Diagnostics.Tests
// Assert
// get the root of the activity for scope "test2"
var root1 = (store.GetActivities()).Where(a => a.Root.State.Equals("test2"))?.FirstOrDefault()?.Root;
var root1 = (store.GetActivities())
.Where(a => string.Equals(a.Root.State?.ToString(), "test2"))?
.FirstOrDefault()?
.Root;
Assert.NotNull(root1);
var root2 = (store.GetActivities()).Where(a => a.Root.State.Equals("test12"))?.FirstOrDefault()?.Root;
var root2 = (store.GetActivities())
.Where(a => string.Equals(a.Root.State?.ToString(), "test12"))?
.FirstOrDefault()?
.Root;
Assert.NotNull(root2);
Assert.Equal(0, root1.Children.Count);
@ -269,7 +275,9 @@ namespace Microsoft.AspNet.Diagnostics.Tests
// Assert
Assert.Single(store.GetActivities());
var context = store.GetActivities().Where(a => a.Root.State.Equals("test8")).First();
var context = store.GetActivities()
.Where(a => string.Equals(a.Root.State?.ToString(), "test8"))
.First();
Assert.Empty(context.Root.Children);
}