Use ILogger instead of Console.WriteLine

This commit is contained in:
rafael-aero
2021-08-26 09:55:14 +02:00
parent 2f0229235b
commit 44d979fef4
7 changed files with 50 additions and 19 deletions

View File

@@ -1,10 +1,25 @@
namespace ElectronNET.API
using Microsoft.Extensions.Logging;
namespace ElectronNET.API
{
/// <summary>
/// The Electron.NET API
/// </summary>
public static class Electron
{
private static ILoggerFactory loggerFactory;
/// <summary>
/// Sets the logger factory to be used by Electron, if any
/// </summary>
public static ILoggerFactory LoggerFactory
{
private get => loggerFactory; set
{
loggerFactory = value;
BridgeConnector.Logger = value.CreateLogger<App>();
}
}
/// <summary>
/// Communicate asynchronously from the main process to renderer processes.
/// </summary>