Skip to content

Commit

Permalink
Fix ILogger registration
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Oct 16, 2024
1 parent a09ea52 commit 39a04c7
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,11 @@ namespace {{root_namespace}}
var eventSource = new global::Yapoml.Playwright.Events.EventSource();
spaceOptions.Services.Register<global::Yapoml.Playwright.Events.IEventSource>(eventSource);

var logger = new global::Yapoml.Framework.Logging.Logger();
spaceOptions.Services.Register<global::Yapoml.Framework.Logging.ILogger>(logger);

spaceOptionsCallback?.Invoke(spaceOptions);

// default logger
global::Yapoml.Framework.Logging.ILogger logger;
if (!spaceOptions.Services.TryGet<global::Yapoml.Framework.Logging.ILogger>(out logger))
{
logger = new global::Yapoml.Framework.Logging.Logger();
spaceOptions.Services.Register<global::Yapoml.Framework.Logging.ILogger>(logger);
}
var consoleLoggerSink = new global::Yapoml.Framework.Logging.Sinks.ConsoleLoggerSink(logger);

// default factories
Expand Down

0 comments on commit 39a04c7

Please sign in to comment.