Skip to content
This repository was archived by the owner on Dec 8, 2018. It is now read-only.

Commit 0fd5970

Browse files
committed
Reacting to verbose rename
1 parent 206b7b9 commit 0fd5970

File tree

11 files changed

+61
-48
lines changed

11 files changed

+61
-48
lines changed

samples/DatabaseErrorPageSample/Properties/launchSettings.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:41542/",
7+
"sslPort": 0
8+
}
9+
},
210
"profiles": {
311
"IIS Express": {
412
"commandName": "IISExpress",
@@ -9,7 +17,10 @@
917
},
1018
"web": {
1119
"commandName": "web",
12-
"commandLineArgs": " "
20+
"commandLineArgs": " ",
21+
"environmentVariables": {
22+
"Hosting:Environment": "Development"
23+
}
1324
}
1425
}
1526
}

samples/ElmPageSample/HelloWorldMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public async Task Invoke(HttpContext httpContext)
2323
{
2424
using (_logger.BeginScope("Scope1"))
2525
{
26-
_logger.LogVerbose("Getting message");
26+
_logger.LogDebug("Getting message");
2727

2828
httpContext.Response.ContentType = "text/html; charset=utf-8";
2929
await httpContext.Response.WriteAsync(

samples/ElmPageSample/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void ConfigureServices(IServiceCollection services)
1515

1616
services.ConfigureElm(elmOptions =>
1717
{
18-
elmOptions.Filter = (loggerName, loglevel) => loglevel == LogLevel.Verbose;
18+
elmOptions.Filter = (loggerName, loglevel) => loglevel == LogLevel.Debug;
1919
});
2020
}
2121

samples/MiddlewareAnalysisSample/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void ConfigureServices(IServiceCollection services)
1818
public void Configure(IApplicationBuilder app, ILoggerFactory factory, DiagnosticListener diagnosticListener)
1919
{
2020
// Displays all log levels
21-
factory.AddConsole(LogLevel.Verbose);
21+
factory.AddConsole(LogLevel.Debug);
2222

2323
// Listen for middleware events and log them to the console.
2424
var listener = new TestDiagnosticListener();

src/Microsoft.AspNet.Diagnostics.Elm/ElmPageMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private async Task<Tuple<ViewOptions, bool>> ParseParams(HttpContext context)
8989
{
9090
var options = new ViewOptions()
9191
{
92-
MinLevel = LogLevel.Verbose,
92+
MinLevel = LogLevel.Debug,
9393
NamePrefix = string.Empty
9494
};
9595
var isRedirect = false;

src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public HelperResult Traverse(ScopeNode node, int level, Dictionary<string, int>
109109
{
110110
Name = node.Name,
111111
Time = node.StartTime,
112-
Severity = LogLevel.Verbose,
112+
Severity = LogLevel.Debug,
113113
Message = "Beginning " + node.State,
114114
}, level));
115115

@@ -150,7 +150,7 @@ public HelperResult Traverse(ScopeNode node, int level, Dictionary<string, int>
150150
{
151151
Name = node.Name,
152152
Time = node.EndTime,
153-
Severity = LogLevel.Verbose,
153+
Severity = LogLevel.Debug,
154154
Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime)
155155
}, level));
156156
});
@@ -183,7 +183,7 @@ public override async Task ExecuteAsync()
183183
<script src=""//ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.1.min.js""></script>
184184
<style>
185185
body {\r\n font-size: .813em;\r\n white-space: nowrap;\r\n margin: 20px;\r\n}\r\n\r\ncol:nth-child(2n) {\r\n background-color: #FAFAFA;\r\n}\r\n\r\nform { \r\n display: inline-block; \r\n}\r\n\r\nh1 {\r\n margin-left: 25px;\r\n}\r\n\r\ntable {\r\n margin: 0px auto;\r\n border-collapse: collapse;\r\n border-spacing: 0px;\r\n table-layout: fixed;\r\n width: 100%;\r\n}\r\n\r\ntd, th {\r\n padding: 4px;\r\n}\r\n\r\nthead {\r\n font-size: 1em;\r\n font-family: Arial;\r\n}\r\n\r\ntr {\r\n height: 23px;\r\n}\r\n\r\n#requestHeader {\r\n border-bottom: solid 1px gray;\r\n border-top: solid 1px gray;\r\n margin-bottom: 2px;\r\n font-size: 1em;\r\n line-height: 2em;\r\n}\r\n\r\n.collapse {\r\n color: black;\r\n float: right;\r\n font-weight: normal;\r\n width: 1em;\r\n}\r\n\r\n.date, .time {\r\n width: 70px; \r\n}\r\n\r\n.logHeader {\r\n border-bottom: 1px solid lightgray;\r\n color: gray;\r\n text-align: left;\r\n}\r\n\r\n.logState {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n}\r\n\r\n.logTd {\r\n border-left: 1px solid gray;\r\n padding: 0px;\r\n}\r\n\r\n.logs {\r\n width: 80%;\r\n}\r\n\r\n.logRow:hover {\r\n background-color: #D6F5FF;\r\n}\r\n\r\n.requestRow>td {\r\n border-bottom: solid 1px gray;\r\n}\r\n\r\n.severity {\r\n width: 80px;\r\n}\r\n\r\n.summary {\r\n color: black;\r\n line-height: 1.8em;\r\n}\r\n\r\n.summary>th {\r\n font-weight: normal;\r\n}\r\n\r\n.tab {\r\n margin-left: 30px;\r\n}\r\n\r\n#viewOptions {\r\n margin: 20px;\r\n}\r\n\r\n#viewOptions > * {\r\n margin: 5px;\r\n}
186-
body {\r\n font-family: 'Segoe UI', Tahoma, Arial, Helvtica, sans-serif;\r\n line-height: 1.4em;\r\n}\r\n\r\nh1 {\r\n font-family: 'Segoe UI', Helvetica, sans-serif;\r\n font-size: 2.5em;\r\n}\r\n\r\ntd {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n}\r\n\r\ntr:nth-child(2n) {\r\n background-color: #F6F6F6;\r\n}\r\n\r\n.critical {\r\n background-color: red;\r\n color: white;\r\n}\r\n\r\n.error {\r\n color: red;\r\n}\r\n\r\n.information {\r\n color: blue;\r\n}\r\n\r\n.verbose {\r\n color: black;\r\n}\r\n\r\n.warning {\r\n color: orange;\r\n}
186+
body {\r\n font-family: 'Segoe UI', Tahoma, Arial, Helvtica, sans-serif;\r\n line-height: 1.4em;\r\n}\r\n\r\nh1 {\r\n font-family: 'Segoe UI', Helvetica, sans-serif;\r\n font-size: 2.5em;\r\n}\r\n\r\ntd {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n}\r\n\r\ntr:nth-child(2n) {\r\n background-color: #F6F6F6;\r\n}\r\n\r\n.critical {\r\n background-color: red;\r\n color: white;\r\n}\r\n\r\n.error {\r\n color: red;\r\n}\r\n\r\n.information {\r\n color: blue;\r\n}\r\n\r\n.debug {\r\n color: black;\r\n}\r\n\r\n.warning {\r\n color: orange;\r\n}
187187
</style>
188188
</head>
189189
<body>
@@ -208,9 +208,9 @@ public override async Task ExecuteAsync()
208208
#line hidden
209209

210210
WriteLiteral(" <option");
211-
BeginWriteAttribute("value", " value=\"", 4908, "\"", 4928, 1);
211+
BeginWriteAttribute("value", " value=\"", 4904, "\"", 4924, 1);
212212
#line 138 "LogPage.cshtml"
213-
WriteAttributeValue("", 4916, severityInt, 4916, 12, false);
213+
WriteAttributeValue("", 4912, severityInt, 4912, 12, false);
214214

215215
#line default
216216
#line hidden
@@ -231,9 +231,9 @@ public override async Task ExecuteAsync()
231231
#line hidden
232232

233233
WriteLiteral(" <option");
234-
BeginWriteAttribute("value", " value=\"", 5057, "\"", 5077, 1);
234+
BeginWriteAttribute("value", " value=\"", 5053, "\"", 5073, 1);
235235
#line 142 "LogPage.cshtml"
236-
WriteAttributeValue("", 5065, severityInt, 5065, 12, false);
236+
WriteAttributeValue("", 5061, severityInt, 5061, 12, false);
237237

238238
#line default
239239
#line hidden
@@ -253,9 +253,9 @@ public override async Task ExecuteAsync()
253253
#line hidden
254254

255255
WriteLiteral(" </select>\r\n <input type=\"text\" name=\"name\"");
256-
BeginWriteAttribute("value", " value=\"", 5190, "\"", 5223, 1);
256+
BeginWriteAttribute("value", " value=\"", 5186, "\"", 5219, 1);
257257
#line 146 "LogPage.cshtml"
258-
WriteAttributeValue("", 5198, Model.Options.NamePrefix, 5198, 25, false);
258+
WriteAttributeValue("", 5194, Model.Options.NamePrefix, 5194, 25, false);
259259

260260
#line default
261261
#line hidden
@@ -315,16 +315,16 @@ public override async Task ExecuteAsync()
315315
#line hidden
316316

317317
WriteLiteral(" \t<td><a");
318-
BeginWriteAttribute("href", " href=\"", 6287, "\"", 6307, 1);
318+
BeginWriteAttribute("href", " href=\"", 6283, "\"", 6303, 1);
319319
#line 178 "LogPage.cshtml"
320-
WriteAttributeValue("", 6294, activityPath, 6294, 13, false);
320+
WriteAttributeValue("", 6290, activityPath, 6290, 13, false);
321321

322322
#line default
323323
#line hidden
324324
EndWriteAttribute();
325-
BeginWriteAttribute("title", " title=\"", 6308, "\"", 6339, 1);
325+
BeginWriteAttribute("title", " title=\"", 6304, "\"", 6335, 1);
326326
#line 178 "LogPage.cshtml"
327-
WriteAttributeValue("", 6316, activity.HttpInfo.Path, 6316, 23, false);
327+
WriteAttributeValue("", 6312, activity.HttpInfo.Path, 6312, 23, false);
328328

329329
#line default
330330
#line hidden
@@ -363,16 +363,16 @@ public override async Task ExecuteAsync()
363363
#line hidden
364364

365365
WriteLiteral(" <td colspan=\"4\"><a");
366-
BeginWriteAttribute("href", " href=\"", 6729, "\"", 6749, 1);
366+
BeginWriteAttribute("href", " href=\"", 6725, "\"", 6745, 1);
367367
#line 185 "LogPage.cshtml"
368-
WriteAttributeValue("", 6736, activityPath, 6736, 13, false);
368+
WriteAttributeValue("", 6732, activityPath, 6732, 13, false);
369369

370370
#line default
371371
#line hidden
372372
EndWriteAttribute();
373-
BeginWriteAttribute("title", " title=\"", 6750, "\"", 6778, 1);
373+
BeginWriteAttribute("title", " title=\"", 6746, "\"", 6774, 1);
374374
#line 185 "LogPage.cshtml"
375-
WriteAttributeValue("", 6758, activity.Root.State, 6758, 20, false);
375+
WriteAttributeValue("", 6754, activity.Root.State, 6754, 20, false);
376376

377377
#line default
378378
#line hidden
@@ -393,9 +393,9 @@ public override async Task ExecuteAsync()
393393
#line hidden
394394

395395
WriteLiteral(" <td colspan=\"4\"><a");
396-
BeginWriteAttribute("href", " href=\"", 6941, "\"", 6961, 1);
396+
BeginWriteAttribute("href", " href=\"", 6937, "\"", 6957, 1);
397397
#line 189 "LogPage.cshtml"
398-
WriteAttributeValue("", 6948, activityPath, 6948, 13, false);
398+
WriteAttributeValue("", 6944, activityPath, 6944, 13, false);
399399

400400
#line default
401401
#line hidden
@@ -434,7 +434,7 @@ public override async Task ExecuteAsync()
434434
counts["Error"] = 0;
435435
counts["Warning"] = 0;
436436
counts["Information"] = 0;
437-
counts["Verbose"] = 0;
437+
counts["Debug"] = 0;
438438

439439

440440
#line default
@@ -503,7 +503,7 @@ public override async Task ExecuteAsync()
503503
#line 228 "LogPage.cshtml"
504504
foreach (var kvp in counts)
505505
{
506-
if (string.Equals("Verbose", kvp.Key)) {
506+
if (string.Equals("Debug", kvp.Key)) {
507507

508508
#line default
509509
#line hidden

src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
{
6565
Name = node.Name,
6666
Time = node.StartTime,
67-
Severity = LogLevel.Verbose,
67+
Severity = LogLevel.Debug,
6868
Message = "Beginning " + node.State,
6969
}, level));
7070

@@ -105,7 +105,7 @@
105105
{
106106
Name = node.Name,
107107
Time = node.EndTime,
108-
Severity = LogLevel.Verbose,
108+
Severity = LogLevel.Debug,
109109
Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime)
110110
}, level));
111111
});
@@ -207,7 +207,7 @@
207207
counts["Error"] = 0;
208208
counts["Warning"] = 0;
209209
counts["Information"] = 0;
210-
counts["Verbose"] = 0;
210+
counts["Debug"] = 0;
211211
}
212212
<tbody class="logBody">
213213
@if (!activity.RepresentsScope)
@@ -227,7 +227,7 @@
227227
<td>@activity.Time.ToString("MM-dd-yyyy HH:mm:ss")</td>
228228
@foreach (var kvp in counts)
229229
{
230-
if (string.Equals("Verbose", kvp.Key)) {
230+
if (string.Equals("Debug", kvp.Key)) {
231231
<td>@kvp.Value @kvp.Key<span class="collapse">v</span></td>
232232
}
233233
else

src/Microsoft.AspNet.Diagnostics.Elm/Views/Shared.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ tr:nth-child(2n) {
3030
color: blue;
3131
}
3232

33-
.verbose {
33+
.debug {
3434
color: black;
3535
}
3636

src/Microsoft.AspNet.Diagnostics.Entity/DatabaseErrorPageMiddleware.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public virtual async Task Invoke([NotNull] HttpContext context)
9393
var creator = dbContext.GetService<IDatabaseCreator>() as IRelationalDatabaseCreator;
9494
if (creator == null)
9595
{
96-
_logger.LogVerbose(Strings.DatabaseErrorPage_NotRelationalDatabase);
96+
_logger.LogDebug(Strings.DatabaseErrorPage_NotRelationalDatabase);
9797
}
9898
else
9999
{
@@ -140,11 +140,11 @@ from m in migrationsAssembly.Migrations
140140

141141
private static bool ShouldDisplayErrorPage(DataStoreErrorLogger.DataStoreErrorLog lastError, Exception exception, ILogger logger)
142142
{
143-
logger.LogVerbose(Strings.FormatDatabaseErrorPage_AttemptingToMatchException(exception.GetType()));
143+
logger.LogDebug(Strings.FormatDatabaseErrorPage_AttemptingToMatchException(exception.GetType()));
144144

145145
if (!lastError.IsErrorLogged)
146146
{
147-
logger.LogVerbose(Strings.DatabaseErrorPage_NoRecordedException);
147+
logger.LogDebug(Strings.DatabaseErrorPage_NoRecordedException);
148148
return false;
149149
}
150150

@@ -156,11 +156,11 @@ private static bool ShouldDisplayErrorPage(DataStoreErrorLogger.DataStoreErrorLo
156156

157157
if (!match)
158158
{
159-
logger.LogVerbose(Strings.DatabaseErrorPage_NoMatch);
159+
logger.LogDebug(Strings.DatabaseErrorPage_NoMatch);
160160
return false;
161161
}
162162

163-
logger.LogVerbose(Strings.DatabaseErrorPage_Matched);
163+
logger.LogDebug(Strings.DatabaseErrorPage_Matched);
164164
return true;
165165
}
166166
}

src/Microsoft.AspNet.Diagnostics.Entity/MigrationsEndPointMiddleware.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,22 @@ public virtual async Task Invoke([NotNull] HttpContext context)
5858

5959
if (context.Request.Path.Equals(_options.Path))
6060
{
61-
_logger.LogVerbose(Strings.FormatMigrationsEndPointMiddleware_RequestPathMatched(context.Request.Path));
61+
_logger.LogDebug(Strings.FormatMigrationsEndPointMiddleware_RequestPathMatched(context.Request.Path));
6262

6363
var db = await GetDbContext(context, _logger);
6464
if (db != null)
6565
{
6666
try
6767
{
68-
_logger.LogVerbose(Strings.FormatMigrationsEndPointMiddleware_ApplyingMigrations(db.GetType().FullName));
68+
_logger.LogDebug(Strings.FormatMigrationsEndPointMiddleware_ApplyingMigrations(db.GetType().FullName));
6969

7070
db.Database.Migrate();
7171

7272
context.Response.StatusCode = (int)HttpStatusCode.NoContent;
7373
context.Response.Headers.Add("Pragma", new[] { "no-cache" });
7474
context.Response.Headers.Add("Cache-Control", new[] { "no-cache" });
7575

76-
_logger.LogVerbose(Strings.FormatMigrationsEndPointMiddleware_Applied(db.GetType().FullName));
76+
_logger.LogDebug(Strings.FormatMigrationsEndPointMiddleware_Applied(db.GetType().FullName));
7777
}
7878
catch (Exception ex)
7979
{

test/Microsoft.AspNet.Diagnostics.Tests/ElmLoggerTest.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,15 @@ public void DefaultLogsForAllLogLevels()
6767
var store = t.Item2;
6868

6969
// Act
70-
logger.Log(LogLevel.Verbose, 0, _state, null, null);
70+
logger.Log(LogLevel.Trace, 0, _state, null, null);
71+
logger.Log(LogLevel.Debug, 0, _state, null, null);
7172
logger.Log(LogLevel.Information, 0, _state, null, null);
7273
logger.Log(LogLevel.Warning, 0, _state, null, null);
7374
logger.Log(LogLevel.Error, 0, _state, null, null);
7475
logger.Log(LogLevel.Critical, 0, _state, null, null);
7576

7677
// Assert
77-
Assert.Equal(5, (store.GetActivities().SelectMany(a => NodeLogs(a.Root, new List<LogInfo>()))).ToList().Count);
78+
Assert.Equal(6, (store.GetActivities().SelectMany(a => NodeLogs(a.Root, new List<LogInfo>()))).ToList().Count);
7879
}
7980

8081
[Theory]
@@ -83,7 +84,7 @@ public void DefaultLogsForAllLogLevels()
8384
[InlineData(LogLevel.Warning, "bad", 0)]
8485
[InlineData(LogLevel.Critical, "", 1)]
8586
[InlineData(LogLevel.Critical, "test", 1)]
86-
[InlineData(LogLevel.Verbose, "t", 5)]
87+
[InlineData(LogLevel.Trace, "t", 6)]
8788
public void Filter_LogsWhenAppropriate(LogLevel minLevel, string prefix, int count)
8889
{
8990
// Arrange
@@ -92,7 +93,8 @@ public void Filter_LogsWhenAppropriate(LogLevel minLevel, string prefix, int cou
9293
var store = t.Item2;
9394

9495
// Act
95-
logger.Log(LogLevel.Verbose, 0, _state, null, null);
96+
logger.Log(LogLevel.Trace, 0, _state, null, null);
97+
logger.Log(LogLevel.Debug, 0, _state, null, null);
9698
logger.Log(LogLevel.Information, 0, _state, null, null);
9799
logger.Log(LogLevel.Warning, 0, _state, null, null);
98100
logger.Log(LogLevel.Error, 0, _state, null, null);
@@ -248,7 +250,7 @@ public void CollapseTree_DoesNotCollapseWhenLogsExist()
248250
{
249251
using (logger.BeginScope("test7"))
250252
{
251-
logger.LogVerbose("hi");
253+
logger.LogTrace("hi");
252254
}
253255
}
254256

@@ -267,7 +269,7 @@ public void CollapseTree_CollapsesAppropriateNodes()
267269
// Act
268270
using (logger.BeginScope("test8"))
269271
{
270-
logger.LogVerbose("hi");
272+
logger.LogDebug("hi");
271273
using (logger.BeginScope("test9"))
272274
{
273275
}
@@ -331,20 +333,20 @@ public void work()
331333
{
332334
for (var i = 0; i < 5; i++)
333335
{
334-
_logger.LogVerbose(string.Format("xxx {0}", i));
336+
_logger.LogDebug(string.Format("xxx {0}", i));
335337
Thread.Sleep(5);
336338
}
337339
using (_logger.BeginScope("test13"))
338340
{
339341
for (var i = 0; i < 3; i++)
340342
{
341-
_logger.LogVerbose(string.Format("yyy {0}", i));
343+
_logger.LogDebug(string.Format("yyy {0}", i));
342344
Thread.Sleep(200);
343345
}
344346
}
345347
for (var i = 0; i < 7; i++)
346348
{
347-
_logger.LogVerbose(string.Format("zzz {0}", i));
349+
_logger.LogDebug(string.Format("zzz {0}", i));
348350
Thread.Sleep(40);
349351
}
350352
}

0 commit comments

Comments
 (0)