Skip to content

Commit

Permalink
Make transitional classes obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
jkulubya committed Nov 27, 2024
1 parent ac9a387 commit 54555d4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
8 changes: 6 additions & 2 deletions Examples/Executor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ static void Main(string[] args)
SessionSettings settings = new SessionSettings(args[0]);
IApplication executorApp = new Executor();
IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
var loggerFactory = new LoggerFactory([new ScreenLoggerProvider(settings)]);
// var loggerFactory = new LoggerFactory([new FileLogProvider(settings)]);
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.SetMinimumLevel(LogLevel.Trace);
builder.AddProvider(new ScreenLoggerProvider(settings));
builder.AddProvider(new FileLoggerProvider(settings));
});
ThreadedSocketAcceptor acceptor =
new ThreadedSocketAcceptor(executorApp, storeFactory, settings, loggerFactory);
HttpServer srv = new HttpServer(HttpServerPrefix, settings);
Expand Down
5 changes: 4 additions & 1 deletion Examples/SimpleAcceptor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ static void Main(string[] args)
SessionSettings settings = new SessionSettings(args[0]);
IApplication app = new SimpleAcceptorApp();
IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
var loggerFactory = new LoggerFactory([new FileLoggerProvider(settings)]);
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddProvider(new FileLoggerProvider(settings));
});
IAcceptor acceptor = new ThreadedSocketAcceptor(app, storeFactory, settings, loggerFactory);

acceptor.Start();
Expand Down
7 changes: 5 additions & 2 deletions Examples/TradeClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ static void Main(string[] args)
QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file);
TradeClientApp application = new TradeClientApp();
IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
var loggerFactory = new LoggerFactory([new ScreenLoggerProvider(settings)]);
// var loggerFactory = new LoggerFactory([new FileLogProvider(settings)]);
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddProvider(new ScreenLoggerProvider(settings));
// builder.AddProvider(new FileLogProvider(settings));
});
QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, loggerFactory);

// this is a developer-test kludge. do not emulate.
Expand Down
3 changes: 3 additions & 0 deletions QuickFIXn/Logger/FileLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace QuickFix.Logger;

[Obsolete("This class is provided to ease migration from the old logging system to Microsoft.Extensions.Logging." +
"It is an attempt to maintain the behavior of the previous FileLog and FileLogFactory while plugging into the Microsoft.Extensions.Logging ecosystem. " +
"Consider using the more robust logging options available in the .NET ecosystem, like the MS Console logging provider, Serilog and NLog.")]
public class FileLoggerProvider : ILoggerProvider
{
private readonly SessionSettings _settings;
Expand Down
6 changes: 5 additions & 1 deletion QuickFIXn/Logger/NullLoggerProvider.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using Microsoft.Extensions.Logging;
using System;
using Microsoft.Extensions.Logging;

namespace QuickFix.Logger;

[Obsolete("This class is provided to ease migration from the old logging system to Microsoft.Extensions.Logging." +
"It is an attempt to maintain the behavior of the previous NullLog and NullLogFactory while plugging into the Microsoft.Extensions.Logging ecosystem. " +
"Consider using the more robust logging options available in the .NET ecosystem, like the MS Console logging provider, Serilog and NLog.")]
public class NullLoggerProvider : ILoggerProvider
{
public void Dispose(){}
Expand Down
3 changes: 3 additions & 0 deletions QuickFIXn/Logger/ScreenLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace QuickFix.Logger;

[Obsolete("This class is provided to ease migration from the old logging system to Microsoft.Extensions.Logging." +
"It is an attempt to maintain the behavior of the previous ScreenLog and ScreenLogFactory while plugging into the Microsoft.Extensions.Logging ecosystem. " +
"Consider using the more robust logging options available in the .NET ecosystem, like the MS Console logging provider, Serilog and NLog.")]
public class ScreenLoggerProvider : ILoggerProvider
{
private const string SCREEN_LOG_SHOW_INCOMING = "ScreenLogShowIncoming";
Expand Down

0 comments on commit 54555d4

Please sign in to comment.