aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-28 11:42:21 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-28 11:42:21 +0200
commitc726e1f7697d9f0fe8cff387dc64dd00c4980b82 (patch)
tree52d91153ee05a32a8ffcd42c4a9220cb7a517bca /Software/Visual_Studio
parent2f70caaf340063f90529c3302f2f2a78dda9d40c (diff)
downloadTango-c726e1f7697d9f0fe8cff387dc64dd00c4980b82.tar.gz
Tango-c726e1f7697d9f0fe8cff387dc64dd00c4980b82.zip
Change LogManager to Instance.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/LocalSynchronizationViewVM.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/RemoteSynchronizationViewVM.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs9
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs19
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs2
-rw-r--r--Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs4
-rw-r--r--Software/Visual_Studio/Tango.Emulations/EmulatorBase.cs2
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs1
-rw-r--r--Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFilePlayer.cs1
-rw-r--r--Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs1
-rw-r--r--Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs1
-rw-r--r--Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs10
-rw-r--r--Software/Visual_Studio/Tango.Logging/LogManager.cs54
-rw-r--r--Software/Visual_Studio/Tango.Protobuf/CompilerFactory.cs8
-rw-r--r--Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs4
-rw-r--r--Software/Visual_Studio/Tango.Protobuf/CompilerFolderResult.cs2
-rw-r--r--Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs33
-rw-r--r--Software/Visual_Studio/Tango.Settings/SettingsManager.cs2
-rw-r--r--Software/Visual_Studio/Tango.Stubs/StubBase.cs2
-rw-r--r--Software/Visual_Studio/Tango.Synchronization/Conversion/SqlServerToSQLiteConverter.cs2
-rw-r--r--Software/Visual_Studio/Tango.Synchronization/Local/LocalDBComparer.cs2
-rw-r--r--Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs1
-rw-r--r--Software/Visual_Studio/Tango.Transport/Adapters/TcpTransportAdapter.cs1
-rw-r--r--Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs1
-rw-r--r--Software/Visual_Studio/Tango.Transport/Servers/TcpServer.cs1
-rw-r--r--Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs1
-rw-r--r--Software/Visual_Studio/Tango.Transport/TransporterBase.cs1
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Helper.cs4
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs6
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs12
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs5
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MobileEM.UI/MainWindow.xaml.cs1
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Protobuf.UI/App.xaml.cs1
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Synchronization.UI/ViewModels/MainViewVM.cs1
42 files changed, 136 insertions, 74 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs
index 03e022380..e92546b47 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs
@@ -11,6 +11,8 @@ namespace Tango.MachineStudio.Developer.Navigation
{
public class DeveloperNavigationManager
{
+ private LogManager LogManager = LogManager.Default;
+
public void NavigateTo(DeveloperNavigationView view)
{
LogManager.Log(String.Format("Navigating to view {0}...", view.ToString()));
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index b9ef26e9b..500f847ed 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -43,6 +43,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
private IAuthenticationProvider _authentication;
private ObservablesContext _machineDbContext;
private ObservablesContext _activeJobDbContext;
+ private LogManager LogManager = LogManager.Default;
#region Properties
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/LocalSynchronizationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/LocalSynchronizationViewVM.cs
index 2621f622a..fbc2e2d49 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/LocalSynchronizationViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/LocalSynchronizationViewVM.cs
@@ -33,6 +33,7 @@ namespace Tango.MachineStudio.Synchronization.ViewModels
private INotificationProvider _notification;
private bool _isWorking;
private MainViewVM _mainView;
+ private LogManager LogManager = LogManager.Default;
#region Constructors
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/RemoteSynchronizationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/RemoteSynchronizationViewVM.cs
index 0f427643f..74ae72f01 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/RemoteSynchronizationViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/RemoteSynchronizationViewVM.cs
@@ -40,6 +40,7 @@ namespace Tango.MachineStudio.Synchronization.ViewModels
private RemoteDB _remoteDB;
private LocalDB _localDB;
private MainViewVM _mainView;
+ private LogManager LogManager = LogManager.Default;
#region Constructors
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
index b6a131d22..15158f87b 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
@@ -19,6 +19,7 @@ namespace Tango.MachineStudio.UI
public partial class App : Application
{
private WpfGlobalExceptionTrapper exceptionTrapper;
+ private LogManager LogManager = LogManager.Default;
protected override void OnStartup(StartupEventArgs e)
{
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs
index 15c8abcde..36ee95f10 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs
@@ -26,6 +26,7 @@ namespace Tango.MachineStudio.UI
public partial class MainWindow : MetroWindow
{
public static MainWindow Instance { get; set; }
+ private LogManager LogManager = LogManager.Default;
public MainWindow()
{
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs
index 5951137e3..1640af940 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs
@@ -29,6 +29,7 @@ namespace Tango.MachineStudio.UI.Modules
private IAuthenticationProvider _authenticationProvider;
private bool _loaded;
public event EventHandler ModulesLoaded;
+ private LogManager LogManager = LogManager.Default;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultStudioModuleLoader"/> class.
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
index 9538c59af..e80b31e23 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -31,6 +31,7 @@ namespace Tango.MachineStudio.UI.StudioApplication
private INavigationManager _navigationManager;
private IStudioModuleLoader _moduleLoader;
private List<Window> _openedWindows;
+ private LogManager LogManager = LogManager.Default;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultStudioApplicationManager" /> class.
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
index 330bcd6eb..675022276 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
@@ -29,6 +29,8 @@ namespace Tango.MachineStudio.UI
/// </summary>
public class ViewModelLocator
{
+ private LogManager LogManager = LogManager.Default;
+
/// <summary>
/// Initializes a new instance of the ViewModelLocator class.
/// </summary>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
index 9acf26afd..f181ebb45 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
@@ -24,7 +24,7 @@ namespace Tango.MachineStudio.UI.ViewModels
private INotificationProvider _notificationProvider;
private INavigationManager _navigationManager;
private IStudioModuleLoader _studioModuleLoader;
-
+ private LogManager logManager = LogManager.Default;
public IStudioApplicationManager ApplicationManager { get; set; }
/// <summary>
@@ -60,7 +60,7 @@ namespace Tango.MachineStudio.UI.ViewModels
}
catch (Exception ex)
{
- LogManager.Log(ex);
+ logManager.Log(ex);
InvokeUINow(() =>
{
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
index fb2cd5c82..57f1d704c 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
@@ -42,6 +42,7 @@ namespace Tango.MachineStudio.UI.ViewModels
private INavigationManager _navigation;
private bool _isDisconnecting;
private Thread _updateCheckThread;
+ private LogManager logManager = LogManager.Default;
/// <summary>
/// Gets or sets the current loaded module.
@@ -248,7 +249,7 @@ namespace Tango.MachineStudio.UI.ViewModels
}
catch (Exception ex)
{
- LogManager.Log(ex, "Error in version update periodic check...");
+ logManager.Log(ex, "Error in version update periodic check...");
}
Thread.Sleep(TimeSpan.FromMinutes(4));
@@ -322,7 +323,7 @@ namespace Tango.MachineStudio.UI.ViewModels
}
catch (Exception ex)
{
- LogManager.Log(ex);
+ logManager.Log(ex);
_notificationProvider.ShowError(ex.Message);
}
@@ -341,7 +342,7 @@ namespace Tango.MachineStudio.UI.ViewModels
}
catch (Exception ex)
{
- LogManager.Log(ex);
+ logManager.Log(ex);
_notificationProvider.ShowError(ex.Message);
}
@@ -435,7 +436,7 @@ namespace Tango.MachineStudio.UI.ViewModels
}
catch (Exception ex)
{
- LogManager.Log(ex, "Error popping out module " + module.Name);
+ logManager.Log(ex, "Error popping out module " + module.Name);
_notificationProvider.ShowError("Error popping out module " + module.Name);
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
index 6be4ba4ca..ab4fd8e0b 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
@@ -38,6 +38,7 @@ namespace Tango.MachineStudio.UI.ViewModels
public class UpdateViewVM : ViewModel
{
private String _appPath = AppDomain.CurrentDomain.BaseDirectory;
+ private LogManager logManager = LogManager.Default;
private INotificationProvider _notification;
private INavigationManager _navigation;
@@ -147,7 +148,7 @@ namespace Tango.MachineStudio.UI.ViewModels
}
catch (Exception ex)
{
- LogManager.Log(ex, "Error while checking for version update!");
+ logManager.Log(ex, "Error while checking for version update!");
Status = UpdateStatus.Error;
}
finally
@@ -187,7 +188,7 @@ namespace Tango.MachineStudio.UI.ViewModels
try
{
- LogManager.Log("Creating temporary file " + tempFile);
+ logManager.Log("Creating temporary file " + tempFile);
int fileSize = 0;
@@ -202,12 +203,12 @@ namespace Tango.MachineStudio.UI.ViewModels
{
using (FtpClient ftp = new FtpClient(_updateInfo.FtpHost, _updateInfo.UserName, _updateInfo.Password))
{
- LogManager.Log("Connecting to FTP site: " + _updateInfo.FtpHost);
+ logManager.Log("Connecting to FTP site: " + _updateInfo.FtpHost);
ftp.ConnectAsync().Wait();
- LogManager.Log("Retrieving download size...");
+ logManager.Log("Retrieving download size...");
fileSize = (int)ftp.GetFileSize(_updateInfo.FilePath);
- LogManager.Log("Download size: " + fileSize + " bytes.");
- LogManager.Log("Starting download...");
+ logManager.Log("Download size: " + fileSize + " bytes.");
+ logManager.Log("Starting download...");
ftp.DownloadAsync(fs, _updateInfo.FilePath).Wait();
}
}
@@ -225,7 +226,7 @@ namespace Tango.MachineStudio.UI.ViewModels
{
if (args.EventType == ZipProgressEventType.Extracting_AfterExtractEntry)
{
- LogManager.Log("Extracting " + Path.GetFileName(args.CurrentEntry.FileName));
+ logManager.Log("Extracting " + Path.GetFileName(args.CurrentEntry.FileName));
UpdateProgress = ((double)(currentEntry++) / (double)zip.Entries.Count) * 100d;
}
};
@@ -250,7 +251,7 @@ namespace Tango.MachineStudio.UI.ViewModels
}
catch
{
- LogManager.Log("Could not extract file " + entry.FileName);
+ logManager.Log("Could not extract file " + entry.FileName);
}
}
}
@@ -260,7 +261,7 @@ namespace Tango.MachineStudio.UI.ViewModels
}
catch (Exception ex)
{
- LogManager.Log(ex, "Error while extracting update package.");
+ logManager.Log(ex, "Error while extracting update package.");
Status = UpdateStatus.Error;
}
finally
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs
index 5cc95c617..40f242458 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs
@@ -16,6 +16,8 @@ namespace Tango.MachineStudio.UpdateService
{
public class MachineStudioUpdateService : IMachineStudioUpdateService
{
+ private LogManager LogManager = LogManager.Default;
+
private class PendingUpload
{
public String Token { get; set; }
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs
index efed8c818..43f0f422d 100644
--- a/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs
+++ b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs
@@ -55,7 +55,7 @@ namespace Tango.Core.Helpers
{
if (_dispatcher == null)
{
- LogManager.Log(new NullReferenceException("The UI dispatcher was not set!"));
+ LogManager.Default.Log(new NullReferenceException("The UI dispatcher was not set!"));
action();
}
else
@@ -72,7 +72,7 @@ namespace Tango.Core.Helpers
{
if (_dispatcher == null)
{
- LogManager.Log(new NullReferenceException("The UI dispatcher was not set!"));
+ LogManager.Default.Log(new NullReferenceException("The UI dispatcher was not set!"));
action();
}
else
diff --git a/Software/Visual_Studio/Tango.Emulations/EmulatorBase.cs b/Software/Visual_Studio/Tango.Emulations/EmulatorBase.cs
index 161277459..b195d5ccc 100644
--- a/Software/Visual_Studio/Tango.Emulations/EmulatorBase.cs
+++ b/Software/Visual_Studio/Tango.Emulations/EmulatorBase.cs
@@ -18,6 +18,8 @@ namespace Tango.Emulations
/// <seealso cref="Tango.Emulations.IEmulator" />
public abstract class EmulatorBase : ExtendedObject, IEmulator
{
+ private LogManager LogManager = LogManager.Default;
+
#region Properties
private bool _isStarted;
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
index 5cfa95295..d01df5578 100644
--- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
+++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
@@ -39,6 +39,7 @@ namespace Tango.Emulations.Emulators
private double _graphFrequency;
private List<DigitalPin> _digitalOutputPinsStates;
private List<DigitalPin> _digitalInputPinsStates;
+ private LogManager LogManager = LogManager.Default;
#region Constructors
diff --git a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFilePlayer.cs b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFilePlayer.cs
index 1900e49e1..7c70d53b7 100644
--- a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFilePlayer.cs
+++ b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFilePlayer.cs
@@ -24,6 +24,7 @@ namespace Tango.Integration.Diagnostics
private long _diagnosticsDataOffset; //Holds the actual starting position for the diagnostics packets.
private Thread _playThread; //Holds the playing thread.
private TaskCompletionSource<object> _stopTaskSource; //Holds the "Stop" async method completion source.
+ private LogManager LogManager = LogManager.Default;
#region Events
diff --git a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs
index 9f62ae355..e0b772e5a 100644
--- a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs
+++ b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileRecorder.cs
@@ -30,6 +30,7 @@ namespace Tango.Integration.Diagnostics
private TaskCompletionSource<object> _stopCompletionSource; //Holds the "Stop" async method completion source.
private DiagnosticsTimeCodeChannel _timeCodeChannel; //Holds the diagnostics time code channel.
private Stopwatch _stopWatch; //Holds the stop watch for keeping tracks over frames time stamps.
+ private LogManager LogManager = LogManager.Default;
#region Properties
diff --git a/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs
index ba2a9fdef..c0d14d102 100644
--- a/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs
+++ b/Software/Visual_Studio/Tango.Integration/Services/ExternalBridgeScanner.cs
@@ -29,6 +29,7 @@ namespace Tango.Integration.Services
{
private Thread _tcpDiscoveryThread;
private Thread _usbDiscoveryThread;
+ private LogManager LogManager = LogManager.Default;
private ObservableCollection<IExternalBridgeClient> _availableMachines;
/// <summary>
diff --git a/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs b/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs
index bbc3786b4..b0bc3ed76 100644
--- a/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs
+++ b/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs
@@ -87,9 +87,9 @@ namespace Tango.Logging
}
_lastGlobalExceptionTime = DateTime.Now;
- LogManager.OverrideQueue = true;
- LogManager.Log("Application Crashed", LogCategory.Critical);
- LogManager.Log(exception, LogCategory.Critical);
+ LogManager.Default.OverrideQueue = true;
+ LogManager.Default.Log("Application Crashed", LogCategory.Critical);
+ LogManager.Default.Log(exception, LogCategory.Critical);
ApplicationCrashedEventArgs e = new ApplicationCrashedEventArgs(exception);
@@ -97,10 +97,10 @@ namespace Tango.Logging
if (e.TryRecover)
{
- LogManager.Log("Trying application recovery. Ignoring exception...");
+ LogManager.Default.Log("Trying application recovery. Ignoring exception...");
}
- LogManager.OverrideQueue = false;
+ LogManager.Default.OverrideQueue = false;
return e.TryRecover;
}
}
diff --git a/Software/Visual_Studio/Tango.Logging/LogManager.cs b/Software/Visual_Studio/Tango.Logging/LogManager.cs
index 5518c520d..a386d4393 100644
--- a/Software/Visual_Studio/Tango.Logging/LogManager.cs
+++ b/Software/Visual_Studio/Tango.Logging/LogManager.cs
@@ -14,22 +14,38 @@ namespace Tango.Logging
/// <summary>
/// Represents a helper class for logging information and errors.
/// </summary>
- public static class LogManager
+ public class LogManager
{
- private static List<ILogger> _loggers;
- private static ConcurrentQueue<LogItemBase> _logs;
- private static Thread _loggingThread;
- private static bool _isStarted;
+ private List<ILogger> _loggers;
+ private ConcurrentQueue<LogItemBase> _logs;
+ private Thread _loggingThread;
+ private bool _isStarted;
+
+ private static LogManager _default;
+
+ public static LogManager Default
+ {
+ get
+ {
+ if (_default == null)
+ {
+ _default = new LogManager();
+ }
+
+ return _default;
+ }
+ }
+
/// <summary>
/// Gets or sets a value indicating whether to propagate logs instantly (Warning - not thread safe).
/// </summary>
- public static bool OverrideQueue { get; set; }
+ public bool OverrideQueue { get; set; }
/// <summary>
/// Initializes the <see cref="LogManager"/> class.
/// </summary>
- static LogManager()
+ protected LogManager()
{
_loggers = new List<ILogger>();
_logs = new ConcurrentQueue<LogItemBase>();
@@ -45,13 +61,13 @@ namespace Tango.Logging
/// <summary>
/// Gets or sets the logging categories filter.
/// </summary>
- public static List<LogCategory> Categories { get; private set; }
+ public List<LogCategory> Categories { get; private set; }
/// <summary>
/// Registers a logger.
/// </summary>
/// <param name="logger">The logger.</param>
- public static void RegisterLogger(ILogger logger)
+ public void RegisterLogger(ILogger logger)
{
if (logger != null && !_loggers.Contains(logger))
{
@@ -63,7 +79,7 @@ namespace Tango.Logging
/// Unregisters a logger.
/// </summary>
/// <param name="logger">The logger.</param>
- public static void UnregisterLogger(ILogger logger)
+ public void UnregisterLogger(ILogger logger)
{
if (logger != null && _loggers.Contains(logger))
{
@@ -76,7 +92,7 @@ namespace Tango.Logging
/// </summary>
/// <param name="e">Exception.</param>
/// <param name="description">Error description.</param>
- public static Exception Log(Exception e, String description = null, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
+ public Exception Log(Exception e, String description = null, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
{
return Log(e, LogCategory.Error, description, caller, file, lineNumber);
}
@@ -86,7 +102,7 @@ namespace Tango.Logging
/// </summary>
/// <param name="e">Exception.</param>
/// <param name="description">Error description.</param>
- public static Exception Log(Exception e, LogCategory category, String description = null, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
+ public Exception Log(Exception e, LogCategory category, String description = null, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
{
if (!Categories.Contains(category)) return e;
@@ -115,7 +131,7 @@ namespace Tango.Logging
/// Add new message log item.
/// </summary>
/// <param name="message">Message.</param>
- public static String LogFormat(String message, object argument, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
+ public String LogFormat(String message, object argument, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
{
return Log(String.Format(message, argument), LogCategory.General, caller, file, lineNumber);
}
@@ -124,7 +140,7 @@ namespace Tango.Logging
/// Add new message log item.
/// </summary>
/// <param name="message">Message.</param>
- public static String Log(String message, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
+ public String Log(String message, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
{
return Log(message, LogCategory.General, caller, file, lineNumber);
}
@@ -133,7 +149,7 @@ namespace Tango.Logging
/// Add new message log item.
/// </summary>
/// <param name="message">Message.</param>
- public static String Log(String message, LogCategory category, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
+ public String Log(String message, LogCategory category, [CallerMemberName] string caller = null, [CallerFilePath] string file = null, [CallerLineNumber] int lineNumber = 0)
{
if (!Categories.Contains(category)) return message;
@@ -161,7 +177,7 @@ namespace Tango.Logging
/// Appends the log.
/// </summary>
/// <param name="log">The log.</param>
- private static void AppendLog(LogItemBase log)
+ private void AppendLog(LogItemBase log)
{
if (log != null)
{
@@ -175,7 +191,7 @@ namespace Tango.Logging
/// <summary>
/// Starts the logging thread.
/// </summary>
- private static void StartLoggingThread()
+ private void StartLoggingThread()
{
if (!_isStarted)
{
@@ -191,7 +207,7 @@ namespace Tango.Logging
/// </summary>
//[DebuggerStepThrough]
//[DebuggerHidden]
- private static void LoggingThreadMethod()
+ private void LoggingThreadMethod()
{
while (_isStarted)
{
@@ -218,7 +234,7 @@ namespace Tango.Logging
/// <param name="log">The log.</param>
[DebuggerStepThrough]
[DebuggerHidden]
- private static void AppendLogInstantly(LogItemBase log)
+ private void AppendLogInstantly(LogItemBase log)
{
bool wroteLog = false;
diff --git a/Software/Visual_Studio/Tango.Protobuf/CompilerFactory.cs b/Software/Visual_Studio/Tango.Protobuf/CompilerFactory.cs
index 7c0ee54a4..d0a81a5c6 100644
--- a/Software/Visual_Studio/Tango.Protobuf/CompilerFactory.cs
+++ b/Software/Visual_Studio/Tango.Protobuf/CompilerFactory.cs
@@ -21,7 +21,7 @@ namespace Tango.Protobuf
/// <exception cref="ArgumentException">Could not locate protobuf compiler for language " + language.ToString()</exception>
public static IProtoCompiler CreateCompiler(CompilerLanguage language)
{
- LogManager.Log("Generating protobuf compiler for " + language.ToString() + "...");
+ LogManager.Default.Log("Generating protobuf compiler for " + language.ToString() + "...");
foreach (var cType in typeof(CompilerFactory).Assembly.GetTypes().Where(x => x.IsClass && !x.IsAbstract && typeof(IProtoCompiler).IsAssignableFrom(x)))
{
@@ -29,7 +29,7 @@ namespace Tango.Protobuf
if (instance.Language == language) return instance;
}
- throw LogManager.Log(new ArgumentException("Could not locate protobuf compiler for language " + language.ToString()));
+ throw LogManager.Default.Log(new ArgumentException("Could not locate protobuf compiler for language " + language.ToString()));
}
/// <summary>
@@ -57,7 +57,7 @@ namespace Tango.Protobuf
/// <exception cref="ArgumentException">Could not locate protobuf compiler for language " + language.ToString()</exception>
public static IProtoCompiler CreateCompiler(String language)
{
- LogManager.Log("Generating protobuf compiler for " + language.ToString() + "...");
+ LogManager.Default.Log("Generating protobuf compiler for " + language.ToString() + "...");
CompilerLanguage lan = (CompilerLanguage)Enum.Parse(typeof(CompilerLanguage), language, true);
@@ -67,7 +67,7 @@ namespace Tango.Protobuf
if (instance.Language == lan) return instance;
}
- throw LogManager.Log(new ArgumentException("Could not locate protobuf compiler for language " + language.ToString()));
+ throw LogManager.Default.Log(new ArgumentException("Could not locate protobuf compiler for language " + language.ToString()));
}
}
}
diff --git a/Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs b/Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs
index feef53b9a..096caaa21 100644
--- a/Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs
+++ b/Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs
@@ -14,6 +14,8 @@ namespace Tango.Protobuf
/// <seealso cref="Tango.Protobuf.ICompilerResult" />
public class CompilerFileResult : ICompilerResult
{
+ private LogManager logManager = LogManager.Default;
+
/// <summary>
/// Gets the result language.
/// </summary>
@@ -61,7 +63,7 @@ namespace Tango.Protobuf
/// <param name="folder">The folder.</param>
public void Save(String folder)
{
- LogManager.Log("Saving " + Path.Combine(folder, Name) + "...");
+ logManager.Log("Saving " + Path.Combine(folder, Name) + "...");
Directory.CreateDirectory(folder);
File.WriteAllText(Path.Combine(folder, Name), Content);
diff --git a/Software/Visual_Studio/Tango.Protobuf/CompilerFolderResult.cs b/Software/Visual_Studio/Tango.Protobuf/CompilerFolderResult.cs
index 9fa7e7d95..1b2f29151 100644
--- a/Software/Visual_Studio/Tango.Protobuf/CompilerFolderResult.cs
+++ b/Software/Visual_Studio/Tango.Protobuf/CompilerFolderResult.cs
@@ -14,6 +14,8 @@ namespace Tango.Protobuf
/// <seealso cref="Tango.Protobuf.ICompilerResult" />
public class CompilerFolderResult : ICompilerResult
{
+ private LogManager LogManager = LogManager.Default;
+
/// <summary>
/// Initializes a new instance of the <see cref="CompilerFolderResult"/> class.
/// </summary>
diff --git a/Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs
index d2bfde75c..a9322f495 100644
--- a/Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs
+++ b/Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs
@@ -19,6 +19,7 @@ namespace Tango.Protobuf
{
private const String COMPILERS_FOLDER_NAME = "ProtoCompilers"; //Compilers folder name.
protected String _compilersPath; //Compilers folder path.
+ private LogManager logManager = LogManager.Default;
/// <summary>
/// Gets the compiler language.
@@ -53,33 +54,33 @@ namespace Tango.Protobuf
/// </returns>
public virtual IEnumerable<CompilerFileResult> CompileFile(string inputFile)
{
- LogManager.Log("Compiling file " + inputFile);
+ logManager.Log("Compiling file " + inputFile);
String tmpPath = PathHelper.GetTempFolderPath();
- LogManager.Log("Temp path: " + tmpPath);
+ logManager.Log("Temp path: " + tmpPath);
String importsString = "--proto_path \"" + Path.GetDirectoryName(inputFile) + "\" ";
- LogManager.Log("Added import string: " + importsString);
+ logManager.Log("Added import string: " + importsString);
foreach (var path in ImportsFolders)
{
String importStr = "--proto_path \"" + path + "\" ";
importsString += importStr;
- LogManager.Log("Added import string: " + importStr);
+ logManager.Log("Added import string: " + importStr);
}
Process p = new Process();
- LogManager.Log("Compilers folder path: " + _compilersPath);
+ logManager.Log("Compilers folder path: " + _compilersPath);
p.StartInfo.WorkingDirectory = _compilersPath;
String oldCurrentDirectory = Environment.CurrentDirectory;
Environment.CurrentDirectory = _compilersPath;
p.StartInfo.FileName = GetProtoCompilerName();
- LogManager.Log("Protobuf executable path: " + p.StartInfo.FileName);
+ logManager.Log("Protobuf executable path: " + p.StartInfo.FileName);
p.StartInfo.Arguments = String.Format(
"{0} {1}=\"{2}\" \"{3}\"",
@@ -88,7 +89,7 @@ namespace Tango.Protobuf
tmpPath,
inputFile);
- LogManager.Log("Final arguments:\n" + p.StartInfo.Arguments);
+ logManager.Log("Final arguments:\n" + p.StartInfo.Arguments);
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
@@ -98,7 +99,7 @@ namespace Tango.Protobuf
p.StartInfo.RedirectStandardOutput = true;
- LogManager.Log("Executing compilation...");
+ logManager.Log("Executing compilation...");
p.Start();
p.WaitForExit(5000);
@@ -110,7 +111,7 @@ namespace Tango.Protobuf
if (!String.IsNullOrWhiteSpace(error))
{
var lines = error.Split(new[] { '\r', '\n' });
- throw LogManager.Log(new CompilerException() { Issues = lines.Where(x => x.Length > 0).ToList() });
+ throw logManager.Log(new CompilerException() { Issues = lines.Where(x => x.Length > 0).ToList() });
}
List<CompilerFileResult> results = new List<CompilerFileResult>();
@@ -124,14 +125,14 @@ namespace Tango.Protobuf
if (PathHelper.TryDeleteFolder(tmpPath))
{
- LogManager.Log("Removed temp path: " + tmpPath);
+ logManager.Log("Removed temp path: " + tmpPath);
}
else
{
- LogManager.Log("Could not remove temp path: " + tmpPath);
+ logManager.Log("Could not remove temp path: " + tmpPath);
}
- LogManager.Log(Path.GetFileName(inputFile) + "compiled!");
+ logManager.Log(Path.GetFileName(inputFile) + "compiled!");
return results;
}
@@ -159,13 +160,13 @@ namespace Tango.Protobuf
{
if (!UsesDefaultStructure)
{
- LogManager.Log("Compiling folder: " + sourceFolder);
+ logManager.Log("Compiling folder: " + sourceFolder);
ImportsFolders.Clear();
ImportsFolders.AddRange(Directory.GetDirectories(sourceFolder, "*.*", SearchOption.AllDirectories));
var result = CompileFolder(sourceFolder, sourceFolder);
- LogManager.Log(Path.GetFileName(sourceFolder) + "compiled!");
+ logManager.Log(Path.GetFileName(sourceFolder) + "compiled!");
return OnPostProcessFolderCompilation(result);
}
@@ -223,7 +224,7 @@ namespace Tango.Protobuf
/// </returns>
private CompilerFolderResult CompileFolderDefault(string sourceFolder)
{
- LogManager.Log("Compiling folder: " + sourceFolder);
+ logManager.Log("Compiling folder: " + sourceFolder);
Dictionary<string, CompilerFileResult> fileResults = new Dictionary<string, CompilerFileResult>();
ImportsFolders.Clear();
@@ -248,7 +249,7 @@ namespace Tango.Protobuf
PathHelper.TryDeleteFolder(tempPath);
- LogManager.Log(Path.GetFileName(sourceFolder) + "compiled!");
+ logManager.Log(Path.GetFileName(sourceFolder) + "compiled!");
return OnPostProcessFolderCompilation(result);
}
diff --git a/Software/Visual_Studio/Tango.Settings/SettingsManager.cs b/Software/Visual_Studio/Tango.Settings/SettingsManager.cs
index ca213cc3f..7bc15d950 100644
--- a/Software/Visual_Studio/Tango.Settings/SettingsManager.cs
+++ b/Software/Visual_Studio/Tango.Settings/SettingsManager.cs
@@ -15,6 +15,8 @@ namespace Tango.Settings
/// </summary>
public static class SettingsManager
{
+ private static LogManager LogManager = LogManager.Default;
+
/// <summary>
/// Gets or sets a value indicating whether the settings manager is initialized.
/// </summary>
diff --git a/Software/Visual_Studio/Tango.Stubs/StubBase.cs b/Software/Visual_Studio/Tango.Stubs/StubBase.cs
index fb5c87438..ccc1a5496 100644
--- a/Software/Visual_Studio/Tango.Stubs/StubBase.cs
+++ b/Software/Visual_Studio/Tango.Stubs/StubBase.cs
@@ -14,6 +14,8 @@ namespace Tango.Stubs
{
public abstract class StubBase : ExtendedObject, IStub
{
+ private LogManager LogManager = LogManager.Default;
+
[ParameterIgnore]
public ITransporter Transporter { get; set; }
diff --git a/Software/Visual_Studio/Tango.Synchronization/Conversion/SqlServerToSQLiteConverter.cs b/Software/Visual_Studio/Tango.Synchronization/Conversion/SqlServerToSQLiteConverter.cs
index 360198320..de961e24d 100644
--- a/Software/Visual_Studio/Tango.Synchronization/Conversion/SqlServerToSQLiteConverter.cs
+++ b/Software/Visual_Studio/Tango.Synchronization/Conversion/SqlServerToSQLiteConverter.cs
@@ -18,6 +18,8 @@ namespace Tango.Synchronization.Conversion
/// <remarks>The class knows how to convert table and index structures only.</remarks>
public class SqlServerToSQLiteConverter
{
+ private LogManager LogManager = LogManager.Default;
+
#region Public Properties
/// <summary>
/// Gets a value indicating whether this instance is active.
diff --git a/Software/Visual_Studio/Tango.Synchronization/Local/LocalDBComparer.cs b/Software/Visual_Studio/Tango.Synchronization/Local/LocalDBComparer.cs
index 4f19e785f..4a6a85d0e 100644
--- a/Software/Visual_Studio/Tango.Synchronization/Local/LocalDBComparer.cs
+++ b/Software/Visual_Studio/Tango.Synchronization/Local/LocalDBComparer.cs
@@ -15,6 +15,8 @@ namespace Tango.Synchronization.Local
/// <seealso cref="System.IDisposable" />
public class LocalDBComparer : IDBComparer
{
+ private LogManager LogManager = LogManager.Default;
+
/// <summary>
/// Used to notify about the comparer progress using text messages.
/// </summary>
diff --git a/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs b/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs
index d91e77cda..42c97a70b 100644
--- a/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs
+++ b/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBComparer.cs
@@ -21,6 +21,7 @@ namespace Tango.Synchronization.Remote
private local.LocalDB _localDB;
private String _machineSerial;
private List<Diff> _diffs;
+ private LogManager LogManager = LogManager.Default;
/// <summary>
/// Used to notify about the comparer progress using text messages.
diff --git a/Software/Visual_Studio/Tango.Transport/Adapters/TcpTransportAdapter.cs b/Software/Visual_Studio/Tango.Transport/Adapters/TcpTransportAdapter.cs
index 08d3ef1d6..768f0914f 100644
--- a/Software/Visual_Studio/Tango.Transport/Adapters/TcpTransportAdapter.cs
+++ b/Software/Visual_Studio/Tango.Transport/Adapters/TcpTransportAdapter.cs
@@ -23,6 +23,7 @@ namespace Tango.Transport.Adapters
private TcpClient _socket;
private Thread _pullThread;
private bool _initializedFromConstructor;
+ private LogManager LogManager = LogManager.Default;
#region Properties
diff --git a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs
index 50cc569fa..019c7099d 100644
--- a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs
+++ b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs
@@ -16,6 +16,7 @@ namespace Tango.Transport.Adapters
public class UsbTransportAdapter : TransportAdapterBase
{
private SerialPort _serialPort; //Serial port instance used to communicate over the serial port.
+ private LogManager LogManager = LogManager.Default;
/// <summary>
/// Initializes a new instance of the <see cref="UsbTransportAdapter"/> class.
diff --git a/Software/Visual_Studio/Tango.Transport/Servers/TcpServer.cs b/Software/Visual_Studio/Tango.Transport/Servers/TcpServer.cs
index 27c555558..c8453fb25 100644
--- a/Software/Visual_Studio/Tango.Transport/Servers/TcpServer.cs
+++ b/Software/Visual_Studio/Tango.Transport/Servers/TcpServer.cs
@@ -16,6 +16,7 @@ namespace Tango.Transport.Servers
public class TcpServer
{
private TaskScheduler scheduler;
+ private LogManager LogManager = LogManager.Default;
/// <summary>
/// The TcpListener that is encapsulated behind this Server instance.
diff --git a/Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs b/Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs
index 715869520..1f2013fde 100644
--- a/Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs
+++ b/Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs
@@ -14,6 +14,7 @@ namespace Tango.Transport
public abstract class TransportAdapterBase : ITransportAdapter
{
protected const int MAX_BUFFER_SIZE = 1024; //10 MB.
+ private LogManager LogManager = LogManager.Default;
#region Events
diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
index 0ce75fcc6..c31f848d1 100644
--- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
+++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
@@ -32,6 +32,7 @@ namespace Tango.Transport
private Thread _keepAliveThread;
private ITransportAdapter _adapter;
private Dictionary<String, PendingResponse> _pendingResponses;
+ private LogManager LogManager = LogManager.Default;
#region Events
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Helper.cs b/Software/Visual_Studio/Tango.UnitTesting/Helper.cs
index 21e36168c..7c0e639c5 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/Helper.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/Helper.cs
@@ -48,11 +48,11 @@ namespace Tango.UnitTesting
/// </summary>
public static ConsoleLogger InitializeLogging(bool useConsole = false, [CallerMemberName] string testName = null)
{
- LogManager.RegisterLogger(new FileLogger(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "logs", "Unit Testing", testName + ".txt")));
+ LogManager.Default.RegisterLogger(new FileLogger(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "logs", "Unit Testing", testName + ".txt")));
if (useConsole)
{
var consoleLogger = new ConsoleLogger(testName);
- LogManager.RegisterLogger(consoleLogger);
+ LogManager.Default.RegisterLogger(consoleLogger);
return consoleLogger;
}
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs
index 2e3776677..bd95efb67 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/Protobuf_TST.cs
@@ -82,17 +82,17 @@ namespace Tango.UnitTesting
Name = "Segment 2"
});
- LogManager.Log("Write Message:" + Environment.NewLine + JsonConvert.SerializeObject(container.Message, Formatting.Indented));
+ LogManager.Default.Log("Write Message:" + Environment.NewLine + JsonConvert.SerializeObject(container.Message, Formatting.Indented));
var bytes = container.ToBytes();
var parsed = MessageFactory.ParseTangoMessage<JobTicket>(bytes);
- LogManager.Log("Read Message:" + Environment.NewLine + JsonConvert.SerializeObject(parsed.Message, Formatting.Indented));
+ LogManager.Default.Log("Read Message:" + Environment.NewLine + JsonConvert.SerializeObject(parsed.Message, Formatting.Indented));
Assert.AreEqual(container.Message, parsed.Message);
- LogManager.Log("Test Passed!");
+ LogManager.Default.Log("Test Passed!");
console.WaitForConsoleExit().Wait();
}
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs
index f5a43c972..d58a063c8 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs
@@ -14,15 +14,17 @@ namespace Tango.MachineEM.UI
/// </summary>
public partial class App : Application
{
+ private LogManager logManager = LogManager.Default;
+
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
- LogManager.Categories.Clear();
- LogManager.Categories.Add(LogCategory.Critical);
- LogManager.Categories.Add(LogCategory.Error);
- LogManager.Categories.Add(LogCategory.General);
- LogManager.Categories.Add(LogCategory.Warning);
+ logManager.Categories.Clear();
+ logManager.Categories.Add(LogCategory.Critical);
+ logManager.Categories.Add(LogCategory.Error);
+ logManager.Categories.Add(LogCategory.General);
+ logManager.Categories.Add(LogCategory.Warning);
}
}
}
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
index 99be80b29..1c5c7e2e9 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
@@ -19,6 +19,7 @@ namespace Tango.MachineEM.UI.ViewModels
{
private TcpServer TcpServer;
private bool _running;
+ private LogManager logManager = LogManager.Default;
#region Properties
@@ -151,9 +152,9 @@ namespace Tango.MachineEM.UI.ViewModels
Log += log.ToString() + Environment.NewLine;
};
- LogManager.RegisterLogger(logger);
+ logManager.RegisterLogger(logger);
- LogManager.Log("Embedded Emulator Started...");
+ logManager.Log("Embedded Emulator Started...");
Emulator = new MachineEmulator(new BasicTransporter());
diff --git a/Software/Visual_Studio/Utilities/Tango.MobileEM.UI/MainWindow.xaml.cs b/Software/Visual_Studio/Utilities/Tango.MobileEM.UI/MainWindow.xaml.cs
index d12a38c70..6b5abd54a 100644
--- a/Software/Visual_Studio/Utilities/Tango.MobileEM.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MobileEM.UI/MainWindow.xaml.cs
@@ -27,6 +27,7 @@ namespace Tango.MobileEM.UI
public partial class MainWindow : MetroWindow
{
public static MainWindow Instance { get; private set; }
+ private LogManager LogManager = LogManager.Default;
public MainWindow()
{
diff --git a/Software/Visual_Studio/Utilities/Tango.Protobuf.UI/App.xaml.cs b/Software/Visual_Studio/Utilities/Tango.Protobuf.UI/App.xaml.cs
index d2560005a..4a9bf0855 100644
--- a/Software/Visual_Studio/Utilities/Tango.Protobuf.UI/App.xaml.cs
+++ b/Software/Visual_Studio/Utilities/Tango.Protobuf.UI/App.xaml.cs
@@ -16,6 +16,7 @@ namespace Tango.Protobuf.UI
public partial class App : Application
{
private WpfGlobalExceptionTrapper exceptionTrapper;
+ private LogManager LogManager = LogManager.Default;
protected override void OnStartup(StartupEventArgs e)
{
diff --git a/Software/Visual_Studio/Utilities/Tango.Synchronization.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.Synchronization.UI/ViewModels/MainViewVM.cs
index 0cf824d28..df0d26b5c 100644
--- a/Software/Visual_Studio/Utilities/Tango.Synchronization.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/Utilities/Tango.Synchronization.UI/ViewModels/MainViewVM.cs
@@ -20,6 +20,7 @@ namespace Tango.Synchronization.UI.ViewModels
private String _masterDBFile;
private String _slaveDBFile;
private LocalDBComparer _comparer;
+ private LogManager LogManager = LogManager.Default;
#region Properties