/Zzz/MainForm.cs |
@@ -10,6 +10,7 @@ |
using System.Threading.Tasks; |
using System.Windows.Forms; |
using Configuration; |
using MQTTnet.Client.Subscribing; |
using NetSparkleUpdater.Enums; |
using NetSparkleUpdater.SignatureVerifiers; |
using NetSparkleUpdater.UI.WinForms; |
@@ -23,8 +24,6 @@ |
using Zzz.Utilities.Serialization; |
using System.Reflection; |
using System.Net; |
using MQTTnet.Client; |
using MqttClient = Zzz.Clients.MqttClient; |
|
namespace Zzz |
{ |
@@ -56,8 +55,6 @@ |
|
private LogMemorySink _memorySink; |
|
private readonly object _memorySinkLock; |
|
private LogViewForm _logViewForm; |
|
private SparkleUpdater _sparkle; |
@@ -74,19 +71,13 @@ |
{ |
InitializeComponent(); |
_memorySink = new LogMemorySink(); |
_memorySinkLock = new object(); |
|
lock (_memorySinkLock) |
{ |
Log.Logger = new LoggerConfiguration() |
.MinimumLevel.Debug() |
.WriteTo.Conditional(condition => MemorySinkEnabled, |
configureSink => configureSink.Sink(_memorySink)) |
.WriteTo.File( |
Path.Combine(Constants.UserApplicationDirectory, "Logs", $"{Constants.AssemblyName}.log"), |
rollingInterval: RollingInterval.Day) |
.CreateLogger(); |
} |
Log.Logger = new LoggerConfiguration() |
.MinimumLevel.Debug() |
.WriteTo.Conditional(condition => MemorySinkEnabled, configureSink => configureSink.Sink(_memorySink)) |
.WriteTo.File(Path.Combine(Constants.UserApplicationDirectory, "Logs", $"{Constants.AssemblyName}.log"), |
rollingInterval: RollingInterval.Day) |
.CreateLogger(); |
|
// Initialize the sleeper. |
_trigger = new ActionTrigger(Handle); |
@@ -176,12 +167,9 @@ |
return; |
} |
|
lock (_memorySinkLock) |
{ |
_logViewForm = new LogViewForm(this, _memorySink, _memorySinkLock); |
_logViewForm.Closing += LogViewFormClosing; |
_logViewForm.Show(); |
} |
_logViewForm = new LogViewForm(this, _memorySink); |
_logViewForm.Closing += LogViewFormClosing; |
_logViewForm.Show(); |
} |
|
private void LogViewFormClosing(object sender, CancelEventArgs e) |