Skip to content

Commit db46a1b

Browse files
committed
Merge line ending normalization.
2 parents a283c03 + 16befd3 commit db46a1b

17 files changed

+8904
-1529
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,4 @@ FakesAssemblies/
194194

195195
# Visual Studio 6 workspace options file
196196
*.opt
197+
*.orig

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src", "test" ],
33
"sdk": {
4-
"version": "1.0.0-beta8"
4+
"version": "1.0.0-rc1-final"
55
}
66
}

samples/Sample/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
2-
using Microsoft.Framework.Logging;
3-
using ILogger = Microsoft.Framework.Logging.ILogger;
2+
using Microsoft.Extensions.Logging;
3+
using ILogger = Microsoft.Extensions.Logging.ILogger;
44
using Serilog;
55

66
namespace Sample

samples/Sample/Program.cs.orig

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using System;
2+
<<<<<<< HEAD
3+
using Microsoft.Framework.Logging;
4+
using ILogger = Microsoft.Framework.Logging.ILogger;
5+
=======
6+
using Microsoft.Extensions.Logging;
7+
using ILogger = Microsoft.Extensions.Logging.ILogger;
8+
>>>>>>> 16befd32de7d8bb67a17565271e1d2f87d1b4854
9+
using Serilog;
10+
11+
namespace Sample
12+
{
13+
public class Program
14+
{
15+
private readonly ILogger _logger;
16+
17+
public Program()
18+
{
19+
Log.Logger = new LoggerConfiguration()
20+
.MinimumLevel.Debug()
21+
#if DNXCORE50
22+
.WriteTo.TextWriter(Console.Out)
23+
#else
24+
.Enrich.WithMachineName()
25+
.Enrich.WithProcessId()
26+
.Enrich.WithThreadId()
27+
.WriteTo.ColoredConsole()
28+
#endif
29+
.CreateLogger();
30+
31+
_logger = new LoggerFactory()
32+
.AddSerilog()
33+
.CreateLogger(typeof(Program).FullName);
34+
}
35+
36+
public void Main(string[] args)
37+
{
38+
_logger.LogInformation("Starting");
39+
40+
var startTime = DateTimeOffset.UtcNow;
41+
_logger.LogInformation(1, "Started at {StartTime} and 0x{Hello:X} is hex of 42", startTime, 42);
42+
43+
try
44+
{
45+
throw new Exception("Boom");
46+
}
47+
catch (Exception ex)
48+
{
49+
_logger.LogCritical("Unexpected critical error starting application", ex);
50+
_logger.Log(LogLevel.Critical, 0, "Unexpected critical error", ex, null);
51+
// This write should not log anything
52+
_logger.Log(LogLevel.Critical, 0, null, null, null);
53+
_logger.LogError("Unexpected error", ex);
54+
_logger.LogWarning("Unexpected warning", ex);
55+
}
56+
57+
using (_logger.BeginScope("Main"))
58+
{
59+
_logger.LogInformation("Waiting for user input");
60+
var key = Console.Read();
61+
_logger.LogInformation("User pressed {@KeyInfo}", new { Key = key, KeyChar = (char)key });
62+
}
63+
64+
var endTime = DateTimeOffset.UtcNow;
65+
_logger.LogInformation(2, "Stopping at {StopTime}", endTime);
66+
67+
_logger.LogInformation("Stopping");
68+
69+
_logger.LogInformation(Environment.NewLine);
70+
_logger.LogInformation("{Result,-10:l}{StartTime,15:l}{EndTime,15:l}{Duration,15:l}", "RESULT", "START TIME", "END TIME", "DURATION(ms)");
71+
_logger.LogInformation("{Result,-10:l}{StartTime,15:l}{EndTime,15:l}{Duration,15:l}", "------", "----- ----", "--- ----", "------------");
72+
_logger.LogInformation("{Result,-10:l}{StartTime,15:mm:s tt}{EndTime,15:mm:s tt}{Duration,15}", "SUCCESS", startTime, endTime, (endTime - startTime).TotalMilliseconds);
73+
}
74+
}
75+
}

samples/Sample/project.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"licenseUrl": "",
88

99
"dependencies": {
10-
"Microsoft.Framework.Logging": "1.0.0-beta8",
1110
"Serilog.Framework.Logging": "1.0.0-*"
1211
},
1312

@@ -19,11 +18,11 @@
1918
"dnx451": {},
2019
"dnxcore50": {
2120
"dependencies": {
22-
"System.Console": "4.0.0-beta-23019",
23-
"System.Collections": "4.0.10-beta-23019",
24-
"System.Linq": "4.0.0-beta-23019",
25-
"System.Threading": "4.0.10-beta-23019",
26-
"Microsoft.CSharp": "4.0.0-beta-23019"
21+
"System.Console": "4.0.0-beta-23516",
22+
"System.Collections": "4.0.0",
23+
"System.Linq": "4.0.0",
24+
"System.Threading": "4.0.0",
25+
"Microsoft.CSharp": "4.0.0"
2726
}
2827
}
2928
}

0 commit comments

Comments
 (0)