Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Use the standard LoggerFactory with the ConsoleLoggerProvider #19

Merged
merged 1 commit into from
Feb 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Stratis.Bitcoin.Tests/NodeContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging.Console;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using NBitcoin;
using Stratis.Bitcoin.Consensus;
using Stratis.Bitcoin.Logging;
Expand Down Expand Up @@ -64,7 +65,7 @@ public string FolderName

public static NodeContext Create([CallerMemberNameAttribute]string name = null, Network network = null, bool clean = true)
{
Logs.Configure(new FuncLoggerFactory(n => new ConsoleLogger(n, (a, b) => true, false)));
Logs.Configure(new LoggerFactory().AddConsole(LogLevel.Trace, false));
return new NodeContext(name, network, clean);
}

Expand Down
5 changes: 3 additions & 2 deletions Stratis.Bitcoin.Tests/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging.Console;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using NBitcoin;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Logging;
Expand All @@ -15,7 +16,7 @@ class Program
{
public static void Main(string[] args)
{
Logs.Configure(new FuncLoggerFactory(n => new ConsoleLogger(n, (a, b) => true, false)));
Logs.Configure(new LoggerFactory().AddConsole(LogLevel.Trace, false));
new Class1().CanRewind();
}

Expand Down
31 changes: 0 additions & 31 deletions Stratis.Bitcoin/Logging/FuncLoggerFactory.cs

This file was deleted.

4 changes: 3 additions & 1 deletion Stratis.Bitcoin/Logging/Logs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ public class Logs
{
static Logs()
{
Configure(new FuncLoggerFactory(n => new NullLogger()));
Configure(new LoggerFactory());
}

public static void Configure(ILoggerFactory factory)
{
Configuration = factory.CreateLogger("Configuration");
Expand All @@ -24,6 +25,7 @@ public static void Configure(ILoggerFactory factory)
EstimateFee = factory.CreateLogger("EstimateFee");

}

public static ILogger Configuration
{
get; set;
Expand Down
33 changes: 0 additions & 33 deletions Stratis.Bitcoin/Logging/NullLogger.cs

This file was deleted.

5 changes: 3 additions & 2 deletions Stratis.BitcoinD/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging.Console;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using Stratis.Bitcoin;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Logging;
Expand All @@ -14,7 +15,7 @@ public class Program
{
public static void Main(string[] args)
{
Logs.Configure(new FuncLoggerFactory(n => new ConsoleLogger(n, (a, b) => true, false)));
Logs.Configure(new LoggerFactory().AddConsole(LogLevel.Trace, false));
NodeArgs nodeArgs = NodeArgs.GetArgs(args);
FullNode node = new FullNode(nodeArgs);
CancellationTokenSource cts = new CancellationTokenSource();
Expand Down