mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
fixed duplicate logs
This commit is contained in:
@@ -80,7 +80,7 @@ namespace MediaBrowser.ServerApplication
|
||||
{
|
||||
DataContext = this;
|
||||
|
||||
Instance_ConfigurationUpdated(null, EventArgs.Empty);
|
||||
UpdateButtons();
|
||||
|
||||
_logManager.LoggerLoaded += LoadLogWindow;
|
||||
_configurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated;
|
||||
@@ -92,6 +92,21 @@ namespace MediaBrowser.ServerApplication
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
||||
void Instance_ConfigurationUpdated(object sender, EventArgs e)
|
||||
{
|
||||
UpdateButtons();
|
||||
|
||||
Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
var logWindow = App.Instance.Windows.OfType<LogWindow>().FirstOrDefault();
|
||||
|
||||
if ((logWindow == null && _configurationManager.Configuration.ShowLogWindow) || (logWindow != null && !_configurationManager.Configuration.ShowLogWindow))
|
||||
{
|
||||
_logManager.ReloadLogger(_configurationManager.Configuration.EnableDebugLevelLogging ? LogSeverity.Debug : LogSeverity.Info);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void UpdateButtons()
|
||||
{
|
||||
Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
@@ -102,13 +117,6 @@ namespace MediaBrowser.ServerApplication
|
||||
separatorDeveloperTools.Visibility = developerToolsVisibility;
|
||||
cmdReloadServer.Visibility = developerToolsVisibility;
|
||||
cmOpenExplorer.Visibility = developerToolsVisibility;
|
||||
|
||||
var logWindow = App.Instance.Windows.OfType<LogWindow>().FirstOrDefault();
|
||||
|
||||
if ((logWindow == null && _configurationManager.Configuration.ShowLogWindow) || (logWindow != null && !_configurationManager.Configuration.ShowLogWindow))
|
||||
{
|
||||
_logManager.ReloadLogger(_configurationManager.Configuration.EnableDebugLevelLogging ? LogSeverity.Debug : LogSeverity.Info);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -120,6 +128,7 @@ namespace MediaBrowser.ServerApplication
|
||||
void LoadLogWindow(object sender, EventArgs args)
|
||||
{
|
||||
CloseLogWindow();
|
||||
|
||||
Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
// Add our log window if specified
|
||||
|
||||
Reference in New Issue
Block a user