diff --git a/Assemblies/MFDLabs.Concurrency/Implementation/AsyncWorkQueue.cs b/Assemblies/MFDLabs.Concurrency/Implementation/AsyncWorkQueue.cs index 02bd6e66..960bb4bf 100644 --- a/Assemblies/MFDLabs.Concurrency/Implementation/AsyncWorkQueue.cs +++ b/Assemblies/MFDLabs.Concurrency/Implementation/AsyncWorkQueue.cs @@ -65,7 +65,7 @@ private void DoCompletionTask(SuccessFailurePort itemHandlerResult, Action compl var choice = Arbiter.Choice( itemHandlerResult, (success) => completionTask(), - SystemLogger.Singleton.Error + Logger.Singleton.Error ); Arbiter.Activate(_dispatcherQueue, choice); } diff --git a/Assemblies/MFDLabs.Concurrency/Implementation/ConcurrencyService.cs b/Assemblies/MFDLabs.Concurrency/Implementation/ConcurrencyService.cs index 7f93da04..23ccbdb4 100644 --- a/Assemblies/MFDLabs.Concurrency/Implementation/ConcurrencyService.cs +++ b/Assemblies/MFDLabs.Concurrency/Implementation/ConcurrencyService.cs @@ -177,7 +177,7 @@ public void Choice(PortSet resultPortSet, Action handler0, A } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } }, (result1) => @@ -188,7 +188,7 @@ public void Choice(PortSet resultPortSet, Action handler0, A } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } } ); @@ -206,7 +206,7 @@ public void Choice(PortSet resultPortSet, Action successHand Choice( resultPortSet, successHandler, - SystemLogger.Singleton.Error + Logger.Singleton.Error ); } @@ -298,7 +298,7 @@ public void Receive(bool persist, Port result, Action handler) } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } } ); diff --git a/Assemblies/MFDLabs.Concurrency/Implementation/CustomThreadPool.cs b/Assemblies/MFDLabs.Concurrency/Implementation/CustomThreadPool.cs index 9bcd1b30..8ed51afe 100644 --- a/Assemblies/MFDLabs.Concurrency/Implementation/CustomThreadPool.cs +++ b/Assemblies/MFDLabs.Concurrency/Implementation/CustomThreadPool.cs @@ -110,7 +110,7 @@ private void ExecuteWorkItem(WaitQueueItem item) try { ExecutionContext.Run(item.Context, item.Callback.Invoke, item.State); } catch (ThreadAbortException) { } catch (ThreadInterruptedException) { } - catch (Exception ex) { SystemLogger.Singleton.Error(ex); } + catch (Exception ex) { Logger.Singleton.Error(ex); } } private void MonitorPerformance(string instanceName) { @@ -169,7 +169,7 @@ private void MonitorPerformance(string instanceName) #endif } catch (ThreadAbortException) { } - catch (Exception ex) { SystemLogger.Singleton.Error(ex); } + catch (Exception ex) { Logger.Singleton.Error(ex); } } /// diff --git a/Assemblies/MFDLabs.Concurrency/Implementation/RefreshAhead.cs b/Assemblies/MFDLabs.Concurrency/Implementation/RefreshAhead.cs index 194691d6..bd2b75c3 100644 --- a/Assemblies/MFDLabs.Concurrency/Implementation/RefreshAhead.cs +++ b/Assemblies/MFDLabs.Concurrency/Implementation/RefreshAhead.cs @@ -84,7 +84,7 @@ private void Refresh(Func refreshDelegate) } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } } private void Refresh(Action> refreshDelegate) @@ -108,7 +108,7 @@ private void Refresh(Action> refreshDelegate) } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } } diff --git a/Assemblies/MFDLabs.Concurrency/PerformanceMonitors/DispatcherMonitor.cs b/Assemblies/MFDLabs.Concurrency/PerformanceMonitors/DispatcherMonitor.cs index 65cd1027..cf2c3b3d 100644 --- a/Assemblies/MFDLabs.Concurrency/PerformanceMonitors/DispatcherMonitor.cs +++ b/Assemblies/MFDLabs.Concurrency/PerformanceMonitors/DispatcherMonitor.cs @@ -35,7 +35,7 @@ public DispatcherMonitor(Dispatcher dispatcher) private void dispatcher_UnhandledException(object sender, UnhandledExceptionEventArgs e) { - SystemLogger.Singleton.Error(new ApplicationException($"{_dispatcher.Name} had an unhandled exception", e.ExceptionObject as Exception)); + Logger.Singleton.Error(new ApplicationException($"{_dispatcher.Name} had an unhandled exception", e.ExceptionObject as Exception)); } private static void Monitor() @@ -54,7 +54,7 @@ private static void Monitor() } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } if (sleep != TimeSpan.Zero) diff --git a/Assemblies/MFDLabs.Configuration/Logging/ConfigurationLogging.cs b/Assemblies/MFDLabs.Configuration/Logging/ConfigurationLogging.cs index f7d7ab09..f630e493 100644 --- a/Assemblies/MFDLabs.Configuration/Logging/ConfigurationLogging.cs +++ b/Assemblies/MFDLabs.Configuration/Logging/ConfigurationLogging.cs @@ -18,8 +18,8 @@ public static void OverrideDefaultConfigurationLogging(Action internal static void Info(string format, params object[] args) => Log(_overrideOnInformation, format, args); private static void Log(Action overrideLogger, string format, params object[] args) => overrideLogger?.Invoke(format, args); - private static Action _overrideOnError = (f, a) => SystemLogger.Singleton.Error(f, a); - private static Action _overrideOnWarning = (f, a) => SystemLogger.Singleton.Warning(f, a); - private static Action _overrideOnInformation = (f, a) => SystemLogger.Singleton.Info(f, a); + private static Action _overrideOnError = (f, a) => Logger.Singleton.Error(f, a); + private static Action _overrideOnWarning = (f, a) => Logger.Singleton.Warning(f, a); + private static Action _overrideOnInformation = (f, a) => Logger.Singleton.Info(f, a); } } diff --git a/Assemblies/MFDLabs.Discord.Configuration/Clients/VaultConfigurationClient.cs b/Assemblies/MFDLabs.Discord.Configuration/Clients/VaultConfigurationClient.cs index f15b8daa..2d312beb 100644 --- a/Assemblies/MFDLabs.Discord.Configuration/Clients/VaultConfigurationClient.cs +++ b/Assemblies/MFDLabs.Discord.Configuration/Clients/VaultConfigurationClient.cs @@ -77,7 +77,7 @@ private void RefreshToken(object s) _vaultClientRefreshTimer.Change(-1, -1); - SystemLogger.Singleton.Info("Renewing vault client's token, '{0}...'", _tokenStr); + Logger.Singleton.Info("Renewing vault client's token, '{0}...'", _tokenStr); _token.RenewSelfAsync().Wait(); _vaultClientRefreshTimer.Change(TimeSpan.FromHours(0.75), TimeSpan.FromHours(0.75)); } @@ -94,9 +94,9 @@ private static IDictionary FetchWithRetries(Func( } catch (Exception ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); switch (ex) { case ArgumentNullException or ArgumentException: - SystemLogger.Singleton.Warning("There was an argument exception with your setting value " + + Logger.Singleton.Warning("There was an argument exception with your setting value " + $"when trying to cast it to '{type.FullName}', {ex.Message}."); return default; case InvalidCastException: case FormatException: case OverflowException: - SystemLogger.Singleton.Warning("The typeof your setting value could not be casted to the " + + Logger.Singleton.Warning("The typeof your setting value could not be casted to the " + $"type of the real setting value, which is '{type.FullName}', please try again."); return default; default: - SystemLogger.Singleton.Warning($"An unknown exception occurred when trying to update the setting '{settingName}'."); + Logger.Singleton.Warning($"An unknown exception occurred when trying to update the setting '{settingName}'."); return default; } diff --git a/Assemblies/MFDLabs.Grid.Arbiter/Helper/GridDeployer.cs b/Assemblies/MFDLabs.Grid.Arbiter/Helper/GridDeployer.cs index 282375d6..ef0e0f6e 100644 --- a/Assemblies/MFDLabs.Grid.Arbiter/Helper/GridDeployer.cs +++ b/Assemblies/MFDLabs.Grid.Arbiter/Helper/GridDeployer.cs @@ -23,7 +23,7 @@ private static string ConstructHealthCheckUserAgent(string url, string healthyTe private static string GetGridServerLaunchPath() { - SystemLogger.Singleton.Info("Trying to get the grid server's path..."); + Logger.Singleton.Info("Trying to get the grid server's path..."); #if NETFRAMEWORK var gridServicePath = Registry.GetValue( @@ -37,7 +37,7 @@ private static string GetGridServerLaunchPath() if (gridServicePath == null) { - SystemLogger.Singleton.Error("The grid server is not installed on this machine."); + Logger.Singleton.Error("The grid server is not installed on this machine."); throw new InvalidOperationException(CouldNotFindGridServer); } @@ -180,11 +180,11 @@ private static void CheckWorkspace() if (global::MFDLabs.Grid.Properties.Settings.Default.WebServerWorkspacePath.IsNullOrEmpty()) throw new InvalidOperationException("Cannot open web server if the workspace is not set!"); - SystemLogger.Singleton.Info("Checking the existance of the web server at '{0}'", global::MFDLabs.Grid.Properties.Settings.Default.WebServerWorkspacePath); + Logger.Singleton.Info("Checking the existance of the web server at '{0}'", global::MFDLabs.Grid.Properties.Settings.Default.WebServerWorkspacePath); if (!Directory.Exists(global::MFDLabs.Grid.Properties.Settings.Default.WebServerWorkspacePath)) { - SystemLogger.Singleton.Error("Unable to launch the web server because it could not be found at the path: '{0}'", global::MFDLabs.Grid.Properties.Settings.Default.WebServerWorkspacePath); + Logger.Singleton.Error("Unable to launch the web server because it could not be found at the path: '{0}'", global::MFDLabs.Grid.Properties.Settings.Default.WebServerWorkspacePath); throw new InvalidOperationException(CouldNotFindWebServer); } } @@ -199,7 +199,7 @@ public static int LaunchGridServer(string hostName = "localhost", int port = 536 { if (!IsServiceAvailableTcp(hostName, port, 0, 150)) { - SystemLogger.Singleton.Info("Grid server was not running on http://{0}:{1}, try to launch it.", hostName, port); + Logger.Singleton.Info("Grid server was not running on http://{0}:{1}, try to launch it.", hostName, port); var path = GetGridServerLaunchPath(); @@ -241,13 +241,13 @@ public static void LaunchWebServer(int maxAttempts = 15) return; } - SystemLogger.Singleton.Info("Trying to launch web server..."); + Logger.Singleton.Info("Trying to launch web server..."); CheckWorkspace(); for (int attempt = 0; attempt < maxAttempts; ++attempt) { - SystemLogger.Singleton.Info("Trying to contact web server at attempt No. {0}", attempt); + Logger.Singleton.Info("Trying to contact web server at attempt No. {0}", attempt); if (WebServerIsAvailable(out aliveButBadCheck)) { @@ -273,13 +273,13 @@ public static WebServerDeploymentStatus LaunchWebServerSafe(int maxAttempts = 15 return WebServerDeploymentStatus.Success; } - SystemLogger.Singleton.Info("Trying to launch web server..."); + Logger.Singleton.Info("Trying to launch web server..."); CheckWorkspace(); for (int attempt = 0; attempt < maxAttempts; ++attempt) { - SystemLogger.Singleton.Info("Trying to contact web server at attempt No. {0}", attempt); + Logger.Singleton.Info("Trying to contact web server at attempt No. {0}", attempt); if (WebServerIsAvailable(out aliveButBadCheck)) { diff --git a/Assemblies/MFDLabs.Grid.Arbiter/Helper/GridProcessHelper.cs b/Assemblies/MFDLabs.Grid.Arbiter/Helper/GridProcessHelper.cs index 314dbea8..87d228a9 100644 --- a/Assemblies/MFDLabs.Grid.Arbiter/Helper/GridProcessHelper.cs +++ b/Assemblies/MFDLabs.Grid.Arbiter/Helper/GridProcessHelper.cs @@ -25,14 +25,14 @@ private static (TimeSpan elapsed, int procId) OpenServer(bool onlyWebServer = fa { var sw = Stopwatch.StartNew(); if (onlyWebServer) - SystemLogger.Singleton.Log("Try open Web Server"); + Logger.Singleton.Log("Try open Web Server"); switch (onlyGridServer) { case true: - SystemLogger.Singleton.Log("Try open Grid Server"); + Logger.Singleton.Log("Try open Grid Server"); break; case false when !onlyWebServer: - SystemLogger.Singleton.Log("Try open Grid and Web Server"); + Logger.Singleton.Log("Try open Grid and Web Server"); break; } @@ -42,14 +42,14 @@ private static (TimeSpan elapsed, int procId) OpenServer(bool onlyWebServer = fa if (onlyGridServer) procId = GridDeployer.LaunchGridServer("localhost", gridServerPort != 0 ? gridServerPort : 53640); if (onlyWebServer) GridDeployer.LaunchWebServer(15); - SystemLogger.Singleton.Info( + Logger.Singleton.Info( "Successfully opened '{0}' Server via Memory Roblox Grid Server Deployer", onlyWebServer ? "Web" : onlyGridServer ? "Grid" : "Web and Grid" ); } finally { - SystemLogger.Singleton.Debug( + Logger.Singleton.Debug( "Took {0}s to open Grid Server via Memory Roblox Grid Server Deployer", sw.Elapsed.TotalSeconds.ToString("f7") ); @@ -153,7 +153,7 @@ public static bool KillProcessByPidSafe(int pid) { if (!ProcessHelper.GetProcessById(pid, out var pr)) { - SystemLogger.Singleton.Warning("The process '{0}' is not running, ignoring...", pid); + Logger.Singleton.Warning("The process '{0}' is not running, ignoring...", pid); return false; } @@ -163,13 +163,13 @@ public static bool KillProcessByPidSafe(int pid) #endif ) { - SystemLogger.Singleton.Warning("The process '{0}' is running on a higher context than the current process, ignoring...", pid); + Logger.Singleton.Warning("The process '{0}' is running on a higher context than the current process, ignoring...", pid); return false; } KillProcessByPid(pid); - SystemLogger.Singleton.Info("Successfully closed process '{0}'.", pid); + Logger.Singleton.Info("Successfully closed process '{0}'.", pid); return true; } @@ -177,7 +177,7 @@ private static void KillAllProcessByNameSafe(string name) { if (!ProcessHelper.GetProcessByName(name.ToLower().Replace(".exe", ""), out var pr)) { - SystemLogger.Singleton.Warning("The process '{0}' is not running, ignoring...", name); + Logger.Singleton.Warning("The process '{0}' is not running, ignoring...", name); return; } @@ -188,13 +188,13 @@ private static void KillAllProcessByNameSafe(string name) ) { - SystemLogger.Singleton.Warning("The process '{0}' is running on a higher context than the current process, ignoring...", name); + Logger.Singleton.Warning("The process '{0}' is running on a higher context than the current process, ignoring...", name); return; } KillAllProcessByName(name); - SystemLogger.Singleton.Info("Successfully closed process '{0}'.", name); + Logger.Singleton.Info("Successfully closed process '{0}'.", name); } /// @@ -202,11 +202,11 @@ private static void KillAllProcessByNameSafe(string name) /// public static bool KillServerSafe() { - SystemLogger.Singleton.Log("Trying to close Backend server."); + Logger.Singleton.Log("Trying to close Backend server."); if (!ProcessHelper.GetProcessByWindowTitle(GlobalServerJobSignature, out var server) && !ProcessHelper.GetProcessByWindowTitle(GlobalQuickServerJobSignature, out server)) { - SystemLogger.Singleton.Warning("Backend server is not running, ignoring..."); + Logger.Singleton.Warning("Backend server is not running, ignoring..."); return false; } @@ -217,13 +217,13 @@ public static bool KillServerSafe() ) { // This is quite useless I think - SystemLogger.Singleton.Warning("Backend server is running on a higher context than the current process, ignoring..."); + Logger.Singleton.Warning("Backend server is running on a higher context than the current process, ignoring..."); return false; } KillProcessByPidSafe(server.Id); - SystemLogger.Singleton.Info("Successfully closed backend Server."); + Logger.Singleton.Info("Successfully closed backend Server."); return true; } @@ -232,11 +232,11 @@ public static bool KillServerSafe() /// public static bool KillAllGridServersSafe() { - SystemLogger.Singleton.Log("Trying to close all open grid server instances."); + Logger.Singleton.Log("Trying to close all open grid server instances."); if (!ProcessHelper.GetProcessByName(GridServerSignature, out var server)) { - SystemLogger.Singleton.Warning("There are no grid servers running, ignoring..."); + Logger.Singleton.Warning("There are no grid servers running, ignoring..."); return false; } @@ -246,13 +246,13 @@ public static bool KillAllGridServersSafe() #endif ) { - SystemLogger.Singleton.Warning("The grid server we caught is running on a different context than us, ignoring..."); + Logger.Singleton.Warning("The grid server we caught is running on a different context than us, ignoring..."); return false; } KillAllProcessByNameSafe(GridServerSignatureExe); - SystemLogger.Singleton.Info("Successfully closed all grid server instances."); + Logger.Singleton.Info("Successfully closed all grid server instances."); return true; } diff --git a/Assemblies/MFDLabs.Grid.Arbiter/Implementation/GridServerArbiter.cs b/Assemblies/MFDLabs.Grid.Arbiter/Implementation/GridServerArbiter.cs index 937c4a42..242a0896 100644 --- a/Assemblies/MFDLabs.Grid.Arbiter/Implementation/GridServerArbiter.cs +++ b/Assemblies/MFDLabs.Grid.Arbiter/Implementation/GridServerArbiter.cs @@ -284,7 +284,7 @@ public static int FindNextAvailablePort() if (IsPortInUse(port)) { - SystemLogger.Singleton.Warning("Chosen random port, {0}, is already in use", port); + Logger.Singleton.Warning("Chosen random port, {0}, is already in use", port); continue; } @@ -295,7 +295,7 @@ public static int FindNextAvailablePort() _perfmon.PortAllocationSuccessesPerSecond.Increment(); _perfmon.PortAllocationSuccessAverageTimeTicks.Sample(sw.ElapsedTicks); - SystemLogger.Singleton.Info( + Logger.Singleton.Info( "Port {0} is chosen for the next GridServerInstance. Number of attempts = {1}, time taken = {2} ms", port, i + 1, @@ -303,7 +303,7 @@ public static int FindNextAvailablePort() ); return port; } - SystemLogger.Singleton.Warning("Chosen random port {0} has been used recently. Total number of recently used ports is {1}", port, _cache.Count); + Logger.Singleton.Warning("Chosen random port {0} has been used recently. Total number of recently used ports is {1}", port, _cache.Count); } } sw.Stop(); @@ -343,10 +343,10 @@ public IReadOnlyCollection GetAllInstances() public int KillAllOpenInstancesUnsafe() { var instanceCount = _instances.Count; - SystemLogger.Singleton.LifecycleEvent("Disposing of all grid server instances"); + Logger.Singleton.LifecycleEvent("Disposing of all grid server instances"); foreach (var instance in _instances.ToArray()) { - SystemLogger.Singleton.LifecycleEvent("Disposing of grid server instance: {0}", instance.ToString()); + Logger.Singleton.LifecycleEvent("Disposing of grid server instance: {0}", instance.ToString()); PortAllocation.RemovePortFromCacheIfExists(instance.Port); _instances.Remove(instance); instance.Dispose(); @@ -359,10 +359,10 @@ public int KillAllOpenInstances() lock (_instances) { var instanceCount = _instances.Count; - SystemLogger.Singleton.LifecycleEvent("Disposing of all grid server instances"); + Logger.Singleton.LifecycleEvent("Disposing of all grid server instances"); foreach (var instance in _instances.ToArray()) { - SystemLogger.Singleton.LifecycleEvent("Disposing of grid server instance: {0}", instance.ToString()); + Logger.Singleton.LifecycleEvent("Disposing of grid server instance: {0}", instance.ToString()); PortAllocation.RemovePortFromCacheIfExists(instance.Port); _instances.Remove(instance); @@ -500,7 +500,7 @@ public GridServerInstance QueueUpArbiteredInstanceUnsafe( true, openNowInNewThread ); - SystemLogger.Singleton.Debug("Queueing up arbitered instance '{0}' on host '{1}'", + Logger.Singleton.Debug("Queueing up arbitered instance '{0}' on host '{1}'", instance.Name, instance.Endpoint.Address.Uri.ToString()); _instances.Add(instance); @@ -539,7 +539,7 @@ public LeasedGridServerInstance QueueUpLeasedArbiteredInstanceUnsafe( true, openNowInNewThread ); - SystemLogger.Singleton.Debug("Queueing up leased arbitered instance '{0}' on host '{1}' with lease '{2}'", + Logger.Singleton.Debug("Queueing up leased arbitered instance '{0}' on host '{1}' with lease '{2}'", instance.Name, instance.Endpoint.Address.Uri.ToString(), newLease @@ -575,7 +575,7 @@ public GridServerInstance QueueUpPersistentArbiteredInstanceUnsafe( isPoolable, openNowInNewThread ); - SystemLogger.Singleton.Debug("Queueing up persistent arbitered instance '{0}' on host '{1}'", + Logger.Singleton.Debug("Queueing up persistent arbitered instance '{0}' on host '{1}'", instance.Name, instance.Endpoint.Address.Uri.ToString()); _instances.Add(instance); @@ -608,7 +608,7 @@ public GridServerInstance QueueUpArbiteredInstance( true, openNowInNewThread ); - SystemLogger.Singleton.Debug("Queueing up arbitered instance '{0}' on host '{1}'", + Logger.Singleton.Debug("Queueing up arbitered instance '{0}' on host '{1}'", instance.Name, instance.Endpoint.Address.Uri.ToString()); lock (_instances) @@ -648,7 +648,7 @@ public LeasedGridServerInstance QueueUpLeasedArbiteredInstance( true, openNowInNewThread ); - SystemLogger.Singleton.Debug("Queueing up leased arbitered instance '{0}' on host '{1}' with lease '{2}'", + Logger.Singleton.Debug("Queueing up leased arbitered instance '{0}' on host '{1}' with lease '{2}'", instance.Name, instance.Endpoint.Address.Uri.ToString(), newLease @@ -685,7 +685,7 @@ public GridServerInstance QueueUpPersistentArbiteredInstance( isPoolable, openNowInNewThread ); - SystemLogger.Singleton.Debug("Queueing up persistent arbitered instance '{0}' on host '{1}'", + Logger.Singleton.Debug("Queueing up persistent arbitered instance '{0}' on host '{1}'", instance.Name, instance.Endpoint.Address.Uri.ToString()); lock (_instances) @@ -806,7 +806,7 @@ params object[] args var instance = GetOrCreateGridServerInstance(name, maxAttemptsToHitGridServer, hostName, isPoolable); - SystemLogger.Singleton.Debug("Got the instance '{0}' to execute method '{1}'", instance, method); + Logger.Singleton.Debug("Got the instance '{0}' to execute method '{1}'", instance, method); return InvokeMethodToInvoke(args, methodToInvoke, instance); } @@ -841,7 +841,7 @@ params object[] args var instance = GetOrCreateGridServerInstance(name, maxAttemptsToHitGridServer, hostName, isPoolable); - SystemLogger.Singleton.Debug("Got the instance '{0}' to execute method '{1}'", instance, method); + Logger.Singleton.Debug("Got the instance '{0}' to execute method '{1}'", instance, method); return await InvokeMethodToInvokeAsync(args, methodToInvoke, instance); } @@ -1290,7 +1290,7 @@ private bool TryOpen(bool @unsafe = false) public void Dispose() { GC.SuppressFinalize(this); - SystemLogger.Singleton.LifecycleEvent("Closing instance '{0}'...", _name); + Logger.Singleton.LifecycleEvent("Closing instance '{0}'...", _name); GridProcessHelper.KillProcessByPidSafe(ProcessId); } @@ -1452,16 +1452,16 @@ private T HandleException(string lastMethod, Exception ex) } #if DEBUG || DEBUG_LOGGING_IN_PROD - SystemLogger.Singleton.Error("Exception occurred when trying to execute command '{0}->{1}': {2}. Retrying...", _name, lastMethod, ex.ToDetailedString()); + Logger.Singleton.Error("Exception occurred when trying to execute command '{0}->{1}': {2}. Retrying...", _name, lastMethod, ex.ToDetailedString()); #else - SystemLogger.Singleton.Warning("Exception occurred when trying to execute command '{0}->{1}': {2}. Retrying...", _name, lastMethod, ex.Message); + Logger.Singleton.Warning("Exception occurred when trying to execute command '{0}->{1}': {2}. Retrying...", _name, lastMethod, ex.Message); #endif return default; } private T HandleEndpointNotFoundException(string lastMethod) { - SystemLogger.Singleton.Warning("The grid server instance command the name of '{0}->{1}' threw an EndpointNotFoundException, opening and retrying...", _name, lastMethod); + Logger.Singleton.Warning("The grid server instance command the name of '{0}->{1}' threw an EndpointNotFoundException, opening and retrying...", _name, lastMethod); if (!global::MFDLabs.Grid.Properties.Settings.Default.OpenServiceOnEndpointNotFoundException) return default; @@ -1630,7 +1630,7 @@ private void CheckExpiration() { if (IsExpired) { - SystemLogger.Singleton.Warning("Instance '{0}' lease has expired, disposing...", Name); + Logger.Singleton.Warning("Instance '{0}' lease has expired, disposing...", Name); Dispose(); } else @@ -1638,17 +1638,17 @@ private void CheckExpiration() } public void RenewLease() { - SystemLogger.Singleton.LifecycleEvent("Renewing instance '{0}' lease '{1}', current expiration '{2}'", Name, Lease, Expiration); + Logger.Singleton.LifecycleEvent("Renewing instance '{0}' lease '{1}', current expiration '{2}'", Name, Lease, Expiration); ScheduleExpirationCheck(); } public void SubscribeExpirationListener(OnExpired @delegate) { - SystemLogger.Singleton.Warning("Subscribing expiration listener '{0}.{1}'", @delegate.Method.DeclaringType.FullName, @delegate.Method.Name); + Logger.Singleton.Warning("Subscribing expiration listener '{0}.{1}'", @delegate.Method.DeclaringType.FullName, @delegate.Method.Name); _onExpiredListeners += @delegate; } public void UnsubscribeExpirationListener(OnExpired @delegate) { - SystemLogger.Singleton.Warning("Unsubscribing expiration listener '{0}.{1}'", @delegate.Method.DeclaringType.FullName, @delegate.Method.Name); + Logger.Singleton.Warning("Unsubscribing expiration listener '{0}.{1}'", @delegate.Method.DeclaringType.FullName, @delegate.Method.Name); _onExpiredListeners -= @delegate; } diff --git a/MFDLabs.Grid.AutoDeployer/MFDLabs.Grid.AutoDeployer.csproj b/MFDLabs.Grid.AutoDeployer/MFDLabs.Grid.AutoDeployer.csproj index 3ab5acac..40fd6530 100644 --- a/MFDLabs.Grid.AutoDeployer/MFDLabs.Grid.AutoDeployer.csproj +++ b/MFDLabs.Grid.AutoDeployer/MFDLabs.Grid.AutoDeployer.csproj @@ -10,43 +10,22 @@ Exe - - 0 - TRACE; - pdbonly - true - - - - TRACE;DEBUG; - - bin\Release\ - TRACE; - true - pdbonly - 0 bin\Debug\ - TRACE;DEBUG - true bin\Release\ TRACE;WE_ON_THE_GRID; - true - pdbonly - 0 bin\Debug\ TRACE;DEBUG;WE_ON_THE_GRID - true diff --git a/MFDLabs.Grid.AutoDeployer/Program.cs b/MFDLabs.Grid.AutoDeployer/Program.cs index 25e47e3d..85cbc6cd 100644 --- a/MFDLabs.Grid.AutoDeployer/Program.cs +++ b/MFDLabs.Grid.AutoDeployer/Program.cs @@ -10,12 +10,15 @@ static void Main(string[] args) { var app = new ServiceHostApp(); app.EventLog.Source = "MFDLabs.Grid.AutoDeployer"; + app.EventLog.Log = "MFDLabs.Grid.AutoDeployer"; Console.CancelKeyPress += (sender, e) => app.Stop(); app.HostOpening += AutoDeployerService.Start; app.HostClosing += AutoDeployerService.Stop; app.Process(args); + + Environment.Exit(0); } } } diff --git a/MFDLabs.Grid.AutoDeployer/Service/AutoDeployerService.cs b/MFDLabs.Grid.AutoDeployer/Service/AutoDeployerService.cs index a1d0292e..f3207180 100644 --- a/MFDLabs.Grid.AutoDeployer/Service/AutoDeployerService.cs +++ b/MFDLabs.Grid.AutoDeployer/Service/AutoDeployerService.cs @@ -20,21 +20,20 @@ using MFDLabs.Reflection.Extensions; using MFDLabs.Diagnostics.Extensions; - namespace MFDLabs.Grid.AutoDeployer.Service { internal sealed class AutoDeployerService { // language=regex /// - /// /(((\d{4,})\.(\d{2}).(\d{2}))-((\d{2}).(\d{2}).(\d{2}))_([a-zA-Z0-9\-_]+)_([a-f0-9]{7}))-?(((?i)(net(?i)(standard|coreapp)?)(([0-9]{1,3}\.?){1,2}))-(?i)(release|debug)(?i)(config(?i)(uration)?)?)?/g + /// /(((\d{4,})\.(\d{2}).(\d{2}))-((\d{2}).(\d{2}).(\d{2}))_([a-zA-Z0-9\-_]+)_([a-f0-9]{7}))_?(((?i)(net(?i)(standard|coreapp)?)(([0-9]{1,3}\.?){1,2}))-(?i)(release|debug)(?i)(config(?i)(uration)?)?)?/g ///
///
/// https://regexr.com/6hqa4
/// https://regex101.com/r/og6X9j/1
///
/// Matches the following format:
- /// yyyy.MM.dd-hh.mm.ss_{branch}_{gitShortHash}-{targetFramework}-{configuration}
+ /// yyyy.MM.dd-hh.mm.ss_{branch}_{gitShortHash}_{targetFramework}-{configuration}
///
/// Group 1: Matches default deployment format: yyyy.MM.dd-hh.mm.ss_{branch}_{gitShortHash}
/// Where {branch} is any a-zA-Z0-9 or the `-` character.
@@ -63,17 +62,18 @@ internal sealed class AutoDeployerService ///
/// NOTICE: For .NET Regex, the original match is capture group no.1, so group number 12 would 13 in .NET
///
- private const string DeploymentIdRegex = @"(((\d{4,})\.(\d{2}).(\d{2}))-((\d{2}).(\d{2}).(\d{2}))_([a-zA-Z0-9\-_]+)_([a-f0-9]{7}))-?(((?i)(net(?i)(standard|coreapp)?)(([0-9]{1,3}\.?){1,2}))-(?i)(release|debug)(?i)(config(?i)(uration)?)?)?"; + private const string DeploymentIdRegex = @"(((\d{4,})\.(\d{2}).(\d{2}))-((\d{2}).(\d{2}).(\d{2}))_([a-zA-Z0-9\-_]+)_([a-f0-9]{7}))_?(((?i)(net(?i)(standard|coreapp)?)(([0-9]{1,3}\.?){1,2}))-(?i)(release|debug)(?i)(config(?i)(uration)?)?)?"; // language=regex /// /// \[(?i)(volatile)\] ///
- /// Matches the following string and it's variants: [DEPLOY] + /// Matches the following string and its variants: [DEPLOY] ///
private const string ShouldDeployPreReleaseSearchString = @"\[(?i)(deploy)\]"; private const string UserAgent = "mfdlabs-github-api-client"; - + private const string DeploymentMarkerFilename = ".mfdlabs-deployment-marker"; + private static User _githubUser; private static GitHubClient _gitHubClient; private static RegistryKey _versioningRegKey; @@ -97,24 +97,18 @@ internal sealed class AutoDeployerService public static void Stop(object s, EventArgs e) { - EventLogConsoleSystemLogger.Singleton.LifecycleEvent("Stopping..."); + EventLogLogger.Singleton.LifecycleEvent("Stopping..."); _isRunning = false; _versioningRegKey?.Dispose(); } public static void Start(object s, EventArgs e) { - try - { - Work(); - } - catch (ArgumentException ex) { EventLogConsoleSystemLogger.Singleton.Error(ex); Environment.Exit(1); } - catch (Exception ex) - { - SystemLogger.Singleton.Error(ex.Message); - } + try { Work(); } + catch (ArgumentException ex) { Logger.Singleton.Error(ex.Message); Environment.Exit(1); } + catch (Exception ex) { Logger.Singleton.Error(ex); Environment.Exit(1); } } - + private static void Work() { _versioningRegSubKey = global::MFDLabs.Grid.AutoDeployer.Properties.Settings.Default.VersioningRegistrySubKey; @@ -125,10 +119,12 @@ private static void Work() _primaryDeploymentExecutable = global::MFDLabs.Grid.AutoDeployer.Properties.Settings.Default.DeploymentPrimaryExecutableName; _pollingInterval = global::MFDLabs.Grid.AutoDeployer.Properties.Settings.Default.PollingInterval; - EventLogConsoleSystemLogger.Singleton.LifecycleEvent("Starting..."); + EventLogLogger.Singleton.LifecycleEvent("Starting..."); +#if !DEBUG if (_pollingInterval < TimeSpan.FromSeconds(30)) throw new ArgumentException("The Polling interval cannot be less than 30 seconds."); +#endif if (_deploymentPath.IsNullOrEmpty()) throw new ArgumentException("The Deployment Path cannot be null or empty."); @@ -155,7 +151,7 @@ private static void Work() _cachedVersion = _versioningRegKey?.GetValue(_versioningRegVersionKeyName, null) as string; if (_cachedVersion != null) - EventLogConsoleSystemLogger.Singleton.Info("Got version {0} from registry key HKLM:{1}.{2}", _cachedVersion, _versioningRegSubKey, _versioningRegVersionKeyName); + EventLogLogger.Singleton.Info("Got version {0} from registry key HKLM:{1}.{2}", _cachedVersion, _versioningRegSubKey, _versioningRegVersionKeyName); _githubToken = global::MFDLabs.Grid.AutoDeployer.Properties.Settings.Default.GithubToken; var gheUrl = global::MFDLabs.Grid.AutoDeployer.Properties.Settings.Default.GithubEnterpriseUrl; @@ -174,7 +170,7 @@ private static void Work() _githubUser = _gitHubClient.User.Current().Result; - EventLogConsoleSystemLogger.Singleton.LifecycleEvent("Authenticated to '{0}' as '{1}'. We are setup to fetch releases from '{2}/{3}'", _gitHubClient.BaseAddress, _githubUser.Email, _githubOrgOrAccountName, _githubRepositoryName); + EventLogLogger.Singleton.LifecycleEvent("Authenticated to '{0}' as '{1}'. We are setup to fetch releases from '{2}/{3}'", _gitHubClient.BaseAddress, _githubUser.Email, _githubOrgOrAccountName, _githubRepositoryName); _isRunning = true; @@ -201,18 +197,18 @@ private static void Run() if (r.Assets.Count != 4) { SkipVersion(r.TagName); - EventLogConsoleSystemLogger.Singleton.Warning("Skipping '{0}' because it had more or less than 4 assets.", r.TagName); + EventLogLogger.Singleton.Warning("Skipping '{0}' because it had more or less than 4 assets.", r.TagName); goto SLEEP; } - var regex = $@"{r.TagName}-?(((?i)(net(?i)(standard|coreapp)?)(([0-9]{{1,3}}\.?){{1,2}}))-(?i)(release|debug)(?i)(config(?i)(uration)?)?)?(?i)(\.mfdlabs-(config-)?archive|Unpacker\.(ps1|bat))?"; + var regex = $@"{r.TagName}_?(((?i)(net(?i)(standard|coreapp)?)(([0-9]{{1,3}}\.?){{1,2}}))-(?i)(release|debug)(?i)(config(?i)(uration)?)?)?(?i)(\.mfdlabs-(config-)?archive|Unpacker\.(ps1|bat))?"; foreach (var a in r.Assets) { if (!a.Name.IsMatch(regex)) { SkipVersion(r.TagName); - EventLogConsoleSystemLogger.Singleton.Warning("Skipping '{0}' because the asset '{1}' didn't match '{2}'.", r.TagName, a.Name, regex); + EventLogLogger.Singleton.Warning("Skipping '{0}' because the asset '{1}' didn't match '{2}'.", r.TagName, a.Name, regex); goto SLEEP; } } @@ -221,7 +217,7 @@ private static void Run() if (ProcessHelper.GetProcessByName(_primaryDeploymentExecutable.ToLower().Replace(".exe", ""), out _)) { InvokeMaintenanceCommandOnPreviousExe(r.TagName); - EventLogConsoleSystemLogger.Singleton.Warning("Invoked upgrade message onto bot, sleep for 15 seconds to ensure it receives it."); + EventLogLogger.Singleton.Warning("Invoked upgrade message onto bot, sleep for 15 seconds to ensure it receives it."); Thread.Sleep(TimeSpan.FromSeconds(15)); } #endif @@ -248,7 +244,7 @@ private static void Run() { SkipVersion(r.TagName); FilesHelper.PollDeletionOfFileBlocking(versionDeploymentPath); - EventLogConsoleSystemLogger.Singleton.Error("Unable to deploy version '{0}': The file '{1}' was not found.", r.TagName, primaryExe); + EventLogLogger.Singleton.Error("Unable to deploy version '{0}': The file '{1}' was not found.", r.TagName, primaryExe); goto SLEEP; } @@ -293,7 +289,7 @@ private static void KillAllProcessByNameSafe(string name) { if (!ProcessHelper.GetProcessByName(name.ToLower().Replace(".exe", ""), out var pr)) { - SystemLogger.Singleton.Warning("The process '{0}' is not running, ignoring...", name); + Logger.Singleton.Warning("The process '{0}' is not running, ignoring...", name); return; } @@ -304,13 +300,13 @@ private static void KillAllProcessByNameSafe(string name) ) { - SystemLogger.Singleton.Warning("The process '{0}' is running on a higher context than the current process, ignoring...", name); + Logger.Singleton.Warning("The process '{0}' is running on a higher context than the current process, ignoring...", name); return; } KillAllProcessByName(name); - SystemLogger.Singleton.Info("Successfully closed process '{0}'.", name); + Logger.Singleton.Info("Successfully closed process '{0}'.", name); } private static void KillAllProcessByName(string name) @@ -355,7 +351,7 @@ private static void CleanupArtifacts(ReleaseAsset[] assets) foreach (var asset in assets) { var fqp = Path.Combine(_deploymentPath, asset.Name); - EventLogConsoleSystemLogger.Singleton.Debug("Deleting asset '{0}' from '{1}'", asset.Name, _deploymentPath); + EventLogLogger.Singleton.Debug("Deleting asset '{0}' from '{1}'", asset.Name, _deploymentPath); FilesHelper.PollDeletionOfFileBlocking(fqp, 10); } } @@ -366,16 +362,16 @@ private static bool RunUnpacker(Release release, out string versionDeploymentPat _deploymentPath, ( from f in release.Assets - where f.Name.IsMatch($@"{release.TagName}-?(((?i)(net(?i)(standard|coreapp)?)(([0-9]{{1,3}}\.?){{1,2}}))-(?i)(release|debug)(?i)(config(?i)(uration)?)?)?\.Unpacker\.ps1") + where f.Name.IsMatch($@"{release.TagName}_?(((?i)(net(?i)(standard|coreapp)?)(([0-9]{{1,3}}\.?){{1,2}}))-(?i)(release|debug)(?i)(config(?i)(uration)?)?)?\.Unpacker\.ps1") select f - ).FirstOrDefault().Name + ).FirstOrDefault()?.Name ); versionDeploymentPath = unpackerFile.Replace(".Unpacker.ps1", ""); if (!File.Exists(unpackerFile)) { - EventLogConsoleSystemLogger.Singleton.Error("Unkown unpacker script: {0}. Skipping version...", unpackerFile); + EventLogLogger.Singleton.Error("Unkown unpacker script: {0}. Skipping version...", unpackerFile); return false; } @@ -391,13 +387,13 @@ select f if (proc.ExitCode != 0) { - EventLogConsoleSystemLogger.Singleton.Error("Unpacker script '{0}' failed with exit code '{1}'. Skipping version...", unpackerFile, proc.ExitCode); + EventLogLogger.Singleton.Error("Unpacker script '{0}' failed with exit code '{1}'. Skipping version...", unpackerFile, proc.ExitCode); return false; } if (!Directory.Exists(versionDeploymentPath)) { - EventLogConsoleSystemLogger.Singleton.Error("Unpacker script '{0}' failed: The output deployment was not created at '{1}'. Skipping version...", unpackerFile, versionDeploymentPath); + EventLogLogger.Singleton.Error("Unpacker script '{0}' failed: The output deployment was not created at '{1}'. Skipping version...", unpackerFile, versionDeploymentPath); return false; } @@ -406,7 +402,7 @@ select f private static void DownloadArtifact(string uri, string outputPath) { - EventLogConsoleSystemLogger.Singleton.Debug("Downloading artifact '{0}' to '{1}'", uri, outputPath); + EventLogLogger.Singleton.Debug("Downloading artifact '{0}' to '{1}'", uri, outputPath); using var webClient = new WebClient(); webClient.Headers.Add("User-Agent", UserAgent); @@ -438,12 +434,12 @@ private static bool DetermineIfNewReleaseAvailable(out Release latestRelease) { if (!latestRelease.Name.IsMatch(ShouldDeployPreReleaseSearchString, RegexOptions.Compiled | RegexOptions.IgnoreCase)) { - EventLogConsoleSystemLogger.Singleton.Warning("{0} was marked as prerelease but had no deploy override text in the title, skipping...", latestReleaseVersion); + EventLogLogger.Singleton.Warning("{0} was marked as prerelease but had no deploy override text in the title, skipping...", latestReleaseVersion); return false; } } - EventLogConsoleSystemLogger.Singleton.Debug("Got new release from repository {0}/{1}: {2}. Is Pre-Release: {3}", _githubOrgOrAccountName, _githubRepositoryName, latestReleaseVersion, latestRelease.Prerelease); + EventLogLogger.Singleton.Debug("Got new release from repository {0}/{1}: {2}. Is Pre-Release: {3}", _githubOrgOrAccountName, _githubRepositoryName, latestReleaseVersion, latestRelease.Prerelease); return true; } @@ -463,7 +459,7 @@ where match.Success if (!directoryMatches.Any()) { - EventLogConsoleSystemLogger.Singleton.Warning("Not overwriting registry version as there was no deployments found at path '{0}'.", _deploymentPath); + EventLogLogger.Singleton.Warning("Not overwriting registry version as there was no deployments found at path '{0}'.", _deploymentPath); return; } @@ -484,7 +480,7 @@ where match.Success { _cachedVersion = currentDeployment.Groups[1].Value; - EventLogConsoleSystemLogger.Singleton.Info("Got version from directories: {0}. Updating registry.", _cachedVersion); + EventLogLogger.Singleton.Info("Got version from directories: {0}. Updating registry.", _cachedVersion); WriteVersionToRegistry(); @@ -517,14 +513,11 @@ private static void SetupDeploymentPath() { var deploymentPath = _deploymentPath; - - var markerFileName = Path.Combine(deploymentPath, ".mfdlabs-deployment-marker"); + var markerFileName = Path.Combine(deploymentPath, DeploymentMarkerFilename); if (Directory.Exists(deploymentPath)) { // There is normally a file in here that marks this as reserved to this tool. - // Named .mfdlabs-deployment-marker - if (File.Exists(markerFileName)) return; } @@ -532,19 +525,19 @@ private static void SetupDeploymentPath() if (FilesHelper.IsSubDir(winDir, deploymentPath)) { - EventLogConsoleSystemLogger.Singleton.Error("Cannot create deployment directory as it is reserved by Windows."); + EventLogLogger.Singleton.Error("Cannot create deployment directory as it is reserved by Windows."); Environment.Exit(1); } if (File.Exists(deploymentPath)) { - EventLogConsoleSystemLogger.Singleton.Error("Unable to determine deployment directory, it exists already and is a file."); + EventLogLogger.Singleton.Error("Unable to determine deployment directory, it exists already and is a file."); Environment.Exit(1); } if (!global::MFDLabs.Grid.AutoDeployer.Properties.Settings.Default.CreateDeploymentPathIfNotExists) { - EventLogConsoleSystemLogger.Singleton.Error("Unable to determine deployment directory, it does not exist and the setting CreateDeploymentPathIfNotExists is false."); + EventLogLogger.Singleton.Error("Unable to determine deployment directory, it does not exist and the setting CreateDeploymentPathIfNotExists is false."); Environment.Exit(1); } @@ -552,6 +545,6 @@ private static void SetupDeploymentPath() File.WriteAllText(markerFileName, ""); } - private static void BackgroundWork(Action action) => Task.Factory.StartNew(() => { try { action(); } catch (Exception ex) { EventLogConsoleSystemLogger.Singleton.Error(ex.Message); } }); + private static void BackgroundWork(Action action) => Task.Factory.StartNew(() => { try { action(); } catch (Exception ex) { EventLogLogger.Singleton.Error(ex); } }); } } diff --git a/MFDLabs.Grid.Bot/App.config b/MFDLabs.Grid.Bot/App.config index 9636211f..eebcc91b 100644 --- a/MFDLabs.Grid.Bot/App.config +++ b/MFDLabs.Grid.Bot/App.config @@ -5,6 +5,7 @@
+
@@ -325,6 +326,14 @@ + + + bot + + + Verbose + + diff --git a/MFDLabs.Grid.Bot/Runner.cs b/MFDLabs.Grid.Bot/Runner.cs index 1fc2094c..294dface 100644 --- a/MFDLabs.Grid.Bot/Runner.cs +++ b/MFDLabs.Grid.Bot/Runner.cs @@ -41,13 +41,13 @@ public static void OnGlobalException(Exception ex) "Error", $"Startup Failure: {ex.Message}." ); - SystemLogger.Singleton.LifecycleEvent(PrimaryTaskError); + Logger.Singleton.LifecycleEvent(PrimaryTaskError); PerformanceServer.Stop(); } public static void Invoke(string[] args) { - SystemLogger.Singleton.LifecycleEvent(BadActorMessage); + Logger.Singleton.LifecycleEvent(BadActorMessage); GoogleAnalyticsManager.Initialize( PerfmonCounterRegistryProvider.Registry, @@ -57,14 +57,14 @@ public static void Invoke(string[] args) if (global::MFDLabs.Grid.Bot.Properties.Settings.Default.OnLaunchWarnAboutDebugMode) { GoogleAnalyticsManager.TrackNetworkEvent("Startup", "Warning", "Debug Mode Enabled"); - SystemLogger.Singleton.Warning(DebugMode); + Logger.Singleton.Warning(DebugMode); } #endif if (SystemGlobal.ContextIsAdministrator() && global::MFDLabs.Grid.Bot.Properties.Settings.Default.OnLaunchWarnAboutAdminMode) { GoogleAnalyticsManager.TrackNetworkEvent("Startup", "Warning", "Administrator Context"); - SystemLogger.Singleton.Warning(AdminMode); + Logger.Singleton.Warning(AdminMode); } GoogleAnalyticsManager.TrackNetworkEvent( @@ -75,7 +75,7 @@ public static void Invoke(string[] args) $"'{Directory.GetCurrentDirectory()}' (version {SystemGlobal.AssemblyVersion})." ); - SystemLogger.Singleton.Debug( + Logger.Singleton.Debug( "Process '{0}' opened with file name '{1}' at path '{2}' (version {3}).", SystemGlobal.CurrentProcess.Id.ToString("x"), SystemGlobal.CurrentProcess.ProcessName, @@ -115,6 +115,8 @@ public static void Invoke(string[] args) } InvokeAsync(args).Wait(); + + Environment.Exit(0); } private static async Task InvokeAsync(IEnumerable args) @@ -129,7 +131,7 @@ await GoogleAnalyticsManager.TrackNetworkEventAsync( "Error", "MainTask Failure: No Bot Token." ); - SystemLogger.Singleton.Error(NoBotToken); + Logger.Singleton.Error(NoBotToken); // Case here so backtrace can catch potential hackers trying to use this without a token // (they got assemblies but no configuration) throw new InvalidOperationException(NoBotToken); diff --git a/MFDLabs.Grid.sln b/MFDLabs.Grid.sln index a0bb6e93..cf359b46 100644 --- a/MFDLabs.Grid.sln +++ b/MFDLabs.Grid.sln @@ -46,8 +46,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Http.Client.Monitor EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Logging", "Logging", "{90317702-8FDC-4DB1-A55D-78204BCD1239}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.EventLog", "Assemblies\MFDLabs.EventLog\MFDLabs.EventLog.csproj", "{3FCA88DB-360C-4FD9-AB58-9E84433F8943}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contextual", "Contextual", "{4DCB86B0-EE10-472A-BAF7-90FAAA905656}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.RequestContext", "Assemblies\MFDLabs.RequestContext\MFDLabs.RequestContext.csproj", "{AF7DD657-91AB-4685-BFFD-3E1C2707433F}" @@ -445,22 +443,6 @@ Global {5144814E-EB60-4C86-BF66-D6024F515D4F}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU {5144814E-EB60-4C86-BF66-D6024F515D4F}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU {5144814E-EB60-4C86-BF66-D6024F515D4F}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.DebugDeploy|Any CPU.Build.0 = Debug|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.DebugGrid|Any CPU.ActiveCfg = Debug|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.DebugGrid|Any CPU.Build.0 = Debug|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.DebugGridDeploy|Any CPU.ActiveCfg = Debug|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.DebugGridDeploy|Any CPU.Build.0 = Debug|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.Release|Any CPU.Build.0 = Release|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.ReleaseDeploy|Any CPU.ActiveCfg = Release|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.ReleaseDeploy|Any CPU.Build.0 = Release|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.ReleaseGrid|Any CPU.ActiveCfg = Release|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU - {3FCA88DB-360C-4FD9-AB58-9E84433F8943}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU {AF7DD657-91AB-4685-BFFD-3E1C2707433F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AF7DD657-91AB-4685-BFFD-3E1C2707433F}.Debug|Any CPU.Build.0 = Debug|Any CPU {AF7DD657-91AB-4685-BFFD-3E1C2707433F}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU @@ -1138,7 +1120,6 @@ Global {2C9F5CA5-4BE6-43B7-8C41-226A7D30C24E} = {841D6B21-240B-4023-A97C-B2267B5E56D3} {5144814E-EB60-4C86-BF66-D6024F515D4F} = {35EDBAA7-6EE3-4E10-A149-5227DA2C4772} {90317702-8FDC-4DB1-A55D-78204BCD1239} = {841D6B21-240B-4023-A97C-B2267B5E56D3} - {3FCA88DB-360C-4FD9-AB58-9E84433F8943} = {90317702-8FDC-4DB1-A55D-78204BCD1239} {4DCB86B0-EE10-472A-BAF7-90FAAA905656} = {841D6B21-240B-4023-A97C-B2267B5E56D3} {AF7DD657-91AB-4685-BFFD-3E1C2707433F} = {4DCB86B0-EE10-472A-BAF7-90FAAA905656} {F37EE7E8-D769-4EB8-9F47-2A522B4034FB} = {35EDBAA7-6EE3-4E10-A149-5227DA2C4772} diff --git a/Services.sln b/Services.sln index 5e6949ae..fc7429af 100644 --- a/Services.sln +++ b/Services.sln @@ -19,8 +19,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Diagnostics", "Asse EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.ErrorHandling", "Assemblies\MFDLabs.ErrorHandling\MFDLabs.ErrorHandling.csproj", "{DCF6B7D2-121A-4D56-A964-9C8841DADB15}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.EventLog", "Assemblies\MFDLabs.EventLog\MFDLabs.EventLog.csproj", "{16417AA7-C75D-4A2D-936F-309545FB4EC7}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Logging", "Logging", "{F40956B5-2536-42B2-93A6-74E1C377C45C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "System", "System", "{E0B3BB89-6F74-4013-A83B-9E331782FF2E}" @@ -43,6 +41,26 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configurat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Configuration", "Assemblies\MFDLabs.Configuration\MFDLabs.Configuration.csproj", "{769B806F-910C-4297-B4B6-4E3B190C03E1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hashicorp", "Hashicorp", "{335029A8-E354-4EB6-A28E-0D018BFEE84D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Hashicorp.ConsulClient", "Assemblies\MFDLabs.Hashicorp.ConsulClient\MFDLabs.Hashicorp.ConsulClient.csproj", "{5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Hashicorp.VaultClient", "Assemblies\MFDLabs.Hashicorp.VaultClient\MFDLabs.Hashicorp.VaultClient.csproj", "{8C72FCE2-C559-4DD1-B988-EBE451EA3015}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Threading", "Assemblies\MFDLabs.Threading\MFDLabs.Threading.csproj", "{8A8D03BF-51DB-4132-9EC3-588125C8B2FE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Guards", "Guards", "{28EE97ED-8ADD-4C68-905E-86E5311AA6AB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Sentinels", "Assemblies\MFDLabs.Sentinels\MFDLabs.Sentinels.csproj", "{84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Networking", "Networking", "{437C251F-C5CA-4D9D-BDCF-B9DD2FFB936F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Networking", "Assemblies\MFDLabs.Networking\MFDLabs.Networking.csproj", "{6131788B-81D1-410C-9CA1-6BDE5822DB28}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Metrics", "Metrics", "{6A9E7A46-52AF-4F98-B8C8-90FC1974757D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MFDLabs.Instrumentation", "Assemblies\MFDLabs.Instrumentation\MFDLabs.Instrumentation.csproj", "{5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -151,22 +169,6 @@ Global {DCF6B7D2-121A-4D56-A964-9C8841DADB15}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU {DCF6B7D2-121A-4D56-A964-9C8841DADB15}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU {DCF6B7D2-121A-4D56-A964-9C8841DADB15}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.DebugDeploy|Any CPU.Build.0 = Debug|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.DebugGrid|Any CPU.ActiveCfg = Debug|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.DebugGrid|Any CPU.Build.0 = Debug|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.DebugGridDeploy|Any CPU.ActiveCfg = Debug|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.DebugGridDeploy|Any CPU.Build.0 = Debug|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.Release|Any CPU.Build.0 = Release|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.ReleaseDeploy|Any CPU.ActiveCfg = Release|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.ReleaseDeploy|Any CPU.Build.0 = Release|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.ReleaseGrid|Any CPU.ActiveCfg = Release|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU - {16417AA7-C75D-4A2D-936F-309545FB4EC7}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU {049D6666-81F3-4A8B-BD71-B185D801BA66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {049D6666-81F3-4A8B-BD71-B185D801BA66}.Debug|Any CPU.Build.0 = Debug|Any CPU {049D6666-81F3-4A8B-BD71-B185D801BA66}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU @@ -263,6 +265,102 @@ Global {769B806F-910C-4297-B4B6-4E3B190C03E1}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU {769B806F-910C-4297-B4B6-4E3B190C03E1}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU {769B806F-910C-4297-B4B6-4E3B190C03E1}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.DebugDeploy|Any CPU.Build.0 = Debug|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.DebugGrid|Any CPU.ActiveCfg = Debug|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.DebugGrid|Any CPU.Build.0 = Debug|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.DebugGridDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.DebugGridDeploy|Any CPU.Build.0 = Debug|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.Release|Any CPU.Build.0 = Release|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.ReleaseDeploy|Any CPU.ActiveCfg = Release|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.ReleaseDeploy|Any CPU.Build.0 = Release|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.ReleaseGrid|Any CPU.ActiveCfg = Release|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.DebugDeploy|Any CPU.Build.0 = Debug|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.DebugGrid|Any CPU.ActiveCfg = Debug|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.DebugGrid|Any CPU.Build.0 = Debug|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.DebugGridDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.DebugGridDeploy|Any CPU.Build.0 = Debug|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.Release|Any CPU.Build.0 = Release|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.ReleaseDeploy|Any CPU.ActiveCfg = Release|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.ReleaseDeploy|Any CPU.Build.0 = Release|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.ReleaseGrid|Any CPU.ActiveCfg = Release|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU + {8C72FCE2-C559-4DD1-B988-EBE451EA3015}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.DebugDeploy|Any CPU.Build.0 = Debug|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.DebugGrid|Any CPU.ActiveCfg = Debug|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.DebugGrid|Any CPU.Build.0 = Debug|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.DebugGridDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.DebugGridDeploy|Any CPU.Build.0 = Debug|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.Release|Any CPU.Build.0 = Release|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.ReleaseDeploy|Any CPU.ActiveCfg = Release|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.ReleaseDeploy|Any CPU.Build.0 = Release|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.ReleaseGrid|Any CPU.ActiveCfg = Release|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.Debug|Any CPU.Build.0 = Debug|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.DebugDeploy|Any CPU.Build.0 = Debug|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.DebugGrid|Any CPU.ActiveCfg = Debug|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.DebugGrid|Any CPU.Build.0 = Debug|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.DebugGridDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.DebugGridDeploy|Any CPU.Build.0 = Debug|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.Release|Any CPU.ActiveCfg = Release|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.Release|Any CPU.Build.0 = Release|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.ReleaseDeploy|Any CPU.ActiveCfg = Release|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.ReleaseDeploy|Any CPU.Build.0 = Release|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.ReleaseGrid|Any CPU.ActiveCfg = Release|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.DebugDeploy|Any CPU.Build.0 = Debug|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.DebugGrid|Any CPU.ActiveCfg = Debug|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.DebugGrid|Any CPU.Build.0 = Debug|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.DebugGridDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.DebugGridDeploy|Any CPU.Build.0 = Debug|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.Release|Any CPU.Build.0 = Release|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.ReleaseDeploy|Any CPU.ActiveCfg = Release|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.ReleaseDeploy|Any CPU.Build.0 = Release|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.ReleaseGrid|Any CPU.ActiveCfg = Release|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU + {6131788B-81D1-410C-9CA1-6BDE5822DB28}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.DebugDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.DebugDeploy|Any CPU.Build.0 = Debug|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.DebugGrid|Any CPU.ActiveCfg = Debug|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.DebugGrid|Any CPU.Build.0 = Debug|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.DebugGridDeploy|Any CPU.ActiveCfg = Debug|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.DebugGridDeploy|Any CPU.Build.0 = Debug|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.Release|Any CPU.Build.0 = Release|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.ReleaseDeploy|Any CPU.ActiveCfg = Release|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.ReleaseDeploy|Any CPU.Build.0 = Release|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.ReleaseGrid|Any CPU.ActiveCfg = Release|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.ReleaseGrid|Any CPU.Build.0 = Release|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.ReleaseGridDeploy|Any CPU.ActiveCfg = Release|Any CPU + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E}.ReleaseGridDeploy|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -273,7 +371,6 @@ Global {C0DEEBF7-36D9-4E1C-90D4-3A0CA35C70C4} = {F40956B5-2536-42B2-93A6-74E1C377C45C} {BDB42EC6-1EE7-46F5-B147-985D90EBDF5D} = {E0B3BB89-6F74-4013-A83B-9E331782FF2E} {DCF6B7D2-121A-4D56-A964-9C8841DADB15} = {F40956B5-2536-42B2-93A6-74E1C377C45C} - {16417AA7-C75D-4A2D-936F-309545FB4EC7} = {F40956B5-2536-42B2-93A6-74E1C377C45C} {F40956B5-2536-42B2-93A6-74E1C377C45C} = {72541B93-52D9-47CE-ACCD-9279015ABBC8} {E0B3BB89-6F74-4013-A83B-9E331782FF2E} = {72541B93-52D9-47CE-ACCD-9279015ABBC8} {A562D261-4313-4694-9DD4-428E69EE5A9D} = {72541B93-52D9-47CE-ACCD-9279015ABBC8} @@ -285,6 +382,16 @@ Global {06CE3E72-8BC7-4FC7-A543-497D7C4F5B86} = {E0B3BB89-6F74-4013-A83B-9E331782FF2E} {198E96F8-8329-4E4E-B07F-41C7DECC6A83} = {72541B93-52D9-47CE-ACCD-9279015ABBC8} {769B806F-910C-4297-B4B6-4E3B190C03E1} = {198E96F8-8329-4E4E-B07F-41C7DECC6A83} + {335029A8-E354-4EB6-A28E-0D018BFEE84D} = {72541B93-52D9-47CE-ACCD-9279015ABBC8} + {5D4C789B-98CD-4E56-8BFB-A29758A9A2F8} = {335029A8-E354-4EB6-A28E-0D018BFEE84D} + {8C72FCE2-C559-4DD1-B988-EBE451EA3015} = {335029A8-E354-4EB6-A28E-0D018BFEE84D} + {8A8D03BF-51DB-4132-9EC3-588125C8B2FE} = {E0B3BB89-6F74-4013-A83B-9E331782FF2E} + {28EE97ED-8ADD-4C68-905E-86E5311AA6AB} = {72541B93-52D9-47CE-ACCD-9279015ABBC8} + {84915BB3-6EB8-46F8-83A9-4A8FAA3E7497} = {28EE97ED-8ADD-4C68-905E-86E5311AA6AB} + {437C251F-C5CA-4D9D-BDCF-B9DD2FFB936F} = {72541B93-52D9-47CE-ACCD-9279015ABBC8} + {6131788B-81D1-410C-9CA1-6BDE5822DB28} = {437C251F-C5CA-4D9D-BDCF-B9DD2FFB936F} + {6A9E7A46-52AF-4F98-B8C8-90FC1974757D} = {72541B93-52D9-47CE-ACCD-9279015ABBC8} + {5D59D8C8-6B3C-45F9-BB2A-3F09F1F3326E} = {6A9E7A46-52AF-4F98-B8C8-90FC1974757D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {1738DAC0-DF8A-4C95-8B03-CF31A9A1966E} diff --git a/Shared/MFDLabs.GridCommands/CommandRegistry.cs b/Shared/MFDLabs.GridCommands/CommandRegistry.cs index ffaaf25a..26e98c66 100644 --- a/Shared/MFDLabs.GridCommands/CommandRegistry.cs +++ b/Shared/MFDLabs.GridCommands/CommandRegistry.cs @@ -291,7 +291,7 @@ public static async Task CheckAndRunSlashCommand(SocketSlashCommand command) InsertIntoAverages($"#{channelName} - {channelId}", $"{guildName} - {guildId}", $"{username} @ {userId}", $"Slash Command - {commandAlias}"); Counters.RequestCountN++; - SystemLogger.Singleton.Verbose( + Logger.Singleton.Verbose( "Try execute the slash command '{0}' with the arguments '{1}' from '{2}' ({3}) in guild '{4}' ({5}) - channel '{6}' ({7}).", commandAlias, !args.IsNullOrEmpty() @@ -331,7 +331,7 @@ await command.User.FireEventAsync( Counters.RequestFailedCountN++; - SystemLogger.Singleton.Warning("The slash command '{0}' did not exist.", commandAlias); + Logger.Singleton.Warning("The slash command '{0}' did not exist.", commandAlias); if (global::MFDLabs.Grid.Bot.Properties.Settings.Default.IsAllowedToEchoBackNotFoundCommandException) { InstrumentationPerfmon.NotFoundCommandsThatToldTheFrontendUser.Increment(); @@ -350,7 +350,7 @@ await command.User.FireEventAsync( await command.User.FireEventAsync("SlashCommandDisabled", $"{channelId} {commandAlias} {disabledMessage ?? ""}"); InstrumentationPerfmon.CommandsThatAreDisabled.Increment(); - SystemLogger.Singleton.Warning("The slash command '{0}' is disabled. {1}", + Logger.Singleton.Warning("The slash command '{0}' is disabled. {1}", commandAlias, disabledMessage != null ? $"Because: '{disabledMessage}'" @@ -436,7 +436,7 @@ await command.User.FireEventAsync( sw.Stop(); InstrumentationPerfmon.AverageRequestTime.Sample(sw.Elapsed.TotalMilliseconds); InstrumentationPerfmon.CommandsThatFinished.Increment(); - SystemLogger.Singleton.Debug( + Logger.Singleton.Debug( "Took {0}s to execute command '{1}'{2}.", sw.Elapsed.TotalSeconds, commandAlias, @@ -467,7 +467,7 @@ private static void DeleteSocketCommand(SocketSlashCommand cmd) } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } }); } @@ -490,7 +490,7 @@ public static async Task CheckAndRunCommandByAlias(string commandAlias, string[] InsertIntoAverages($"#{channelName} - {channelId}", $"{guildName} - {guildId}", $"{username} @ {userId}", commandAlias); Counters.RequestCountN++; - SystemLogger.Singleton.Verbose( + Logger.Singleton.Verbose( "Try execute the command '{0}' with the arguments '{1}' from '{2}' ({3}) in guild '{4}' ({5}) - channel '{6}' ({7}).", commandAlias, messageContent.Length > 0 @@ -517,7 +517,7 @@ await message.Author.FireEventAsync( if (commandAlias.IsNullOrWhiteSpace()) { - SystemLogger.Singleton.Warning("We got a prefix in the message, but the command was 0 in length."); + Logger.Singleton.Warning("We got a prefix in the message, but the command was 0 in length."); await message.Author.FireEventAsync("InvalidCommand", "Got prefix but command alias was empty"); return; } @@ -528,7 +528,7 @@ await message.Author.FireEventAsync( !message.Author.IsAdmin() ) { - SystemLogger.Singleton.Warning("We got a prefix in the message, but the command contained non-alphabetic characters, message: {0}", commandAlias); + Logger.Singleton.Warning("We got a prefix in the message, but the command contained non-alphabetic characters, message: {0}", commandAlias); await message.Author.FireEventAsync("InvalidCommand", "The command did not contain alphabet characters."); // should we reply here? return; @@ -549,7 +549,7 @@ await message.Author.FireEventAsync( InstrumentationPerfmon.CommandsThatDidNotExist.Increment(); InstrumentationPerfmon.FailedCommandsPerSecond.Increment(); Counters.RequestFailedCountN++; - SystemLogger.Singleton.Warning("The command '{0}' did not exist.", commandAlias); + Logger.Singleton.Warning("The command '{0}' did not exist.", commandAlias); if (global::MFDLabs.Grid.Bot.Properties.Settings.Default.IsAllowedToEchoBackNotFoundCommandException) { InstrumentationPerfmon.NotFoundCommandsThatToldTheFrontendUser.Increment(); @@ -570,7 +570,7 @@ await message.Author.FireEventAsync( await message.Author.FireEventAsync("CommandDisabled", $"{channelId} {commandAlias} {disabledMessage ?? ""}"); InstrumentationPerfmon.CommandsThatAreDisabled.Increment(); - SystemLogger.Singleton.Warning("The command '{0}' is disabled. {1}", + Logger.Singleton.Warning("The command '{0}' is disabled. {1}", commandAlias, disabledMessage != null ? $"Because: '{disabledMessage}'" @@ -659,7 +659,7 @@ await GetWrapperByCommand(command) sw.Stop(); InstrumentationPerfmon.AverageRequestTime.Sample(sw.Elapsed.TotalMilliseconds); InstrumentationPerfmon.CommandsThatFinished.Increment(); - SystemLogger.Singleton.Debug("Took {0}s to execute command '{1}'{2}.", + Logger.Singleton.Debug("Took {0}s to execute command '{1}'{2}.", sw.Elapsed.TotalSeconds, commandAlias, inNewThread @@ -672,7 +672,7 @@ await GetWrapperByCommand(command) private static void ExecuteSlashCommandInNewThread(string alias, SocketSlashCommand command, IStateSpecificSlashCommandHandler handler, Stopwatch sw) { - SystemLogger.Singleton.LifecycleEvent("Queueing user work item for slash command '{0}'.", alias); + Logger.Singleton.LifecycleEvent("Queueing user work item for slash command '{0}'.", alias); ThreadPool.QueueUserWorkItem(async _ => { @@ -693,7 +693,7 @@ private static void ExecuteSlashCommandInNewThread(string alias, SocketSlashComm sw.Stop(); InstrumentationPerfmon.AverageThreadRequestTime.Sample(sw.Elapsed.TotalMilliseconds); InstrumentationPerfmon.NewThreadCommandsThatFinished.Increment(); - SystemLogger.Singleton.Debug("Took {0}s to execute command '{1}'.", sw.Elapsed.TotalSeconds, alias); + Logger.Singleton.Debug("Took {0}s to execute command '{1}'.", sw.Elapsed.TotalSeconds, alias); } }); @@ -709,7 +709,7 @@ private static void ExecuteCommandInNewThread( IStateSpecificCommandHandler command ) { - SystemLogger.Singleton.LifecycleEvent("Queueing user work item for command '{0}'.", alias); + Logger.Singleton.LifecycleEvent("Queueing user work item for command '{0}'.", alias); // could we have 2 versions here where we pool it and background it? @@ -737,7 +737,7 @@ await GetWrapperByCommand(command) sw.Stop(); InstrumentationPerfmon.AverageThreadRequestTime.Sample(sw.Elapsed.TotalMilliseconds); InstrumentationPerfmon.NewThreadCommandsThatFinished.Increment(); - SystemLogger.Singleton.Debug("Took {0}s to execute command '{1}'.", sw.Elapsed.TotalSeconds, alias); + Logger.Singleton.Debug("Took {0}s to execute command '{1}'.", sw.Elapsed.TotalSeconds, alias); } }); } @@ -755,22 +755,22 @@ private static async Task HandleSlashCommandException(Exception ex, string alias switch (ex) { case NotSupportedException _: - SystemLogger.Singleton.Warning("This could have been a thread pool error, we'll assume that."); + Logger.Singleton.Warning("This could have been a thread pool error, we'll assume that."); return; case ApplicationException _: - SystemLogger.Singleton.Warning("Application threw an exception {0}", ex.ToDetailedString()); + Logger.Singleton.Warning("Application threw an exception {0}", ex.ToDetailedString()); await command.RespondEphemeralPingAsync($"The command threw an exception: {ex.Message}"); return; case TimeoutException _: InstrumentationPerfmon.FailedCommandsThatTimedOut.Increment(); - SystemLogger.Singleton.Error("The command '{0}' timed out. {1}", alias, ex.Message); + Logger.Singleton.Error("The command '{0}' timed out. {1}", alias, ex.Message); await command.RespondEphemeralPingAsync("the command you tried to execute has timed out, please " + "try identify the leading cause of a timeout."); return; case EndpointNotFoundException _: InstrumentationPerfmon.FailedCommandsThatTimedOut.Increment(); InstrumentationPerfmon.FailedCommandsThatTriedToAccessOfflineGridServer.Increment(); - SystemLogger.Singleton.Warning("The grid service was not online."); + Logger.Singleton.Warning("The grid service was not online."); await command.RespondEphemeralPingAsync($"the grid service is not currently running, " + $"please ask <@!{MFDLabs.Grid.Bot.Properties.Settings.Default.BotOwnerID}>" + $" to start the service."); @@ -778,7 +778,7 @@ await command.RespondEphemeralPingAsync($"the grid service is not currently runn case FaultException fault: { InstrumentationPerfmon.FailedCommandsThatTriggeredAFaultException.Increment(); - SystemLogger.Singleton.Warning("An error occured on the grid server: {0}", fault.Message); + Logger.Singleton.Warning("An error occured on the grid server: {0}", fault.Message); if (fault.Message == "Cannot invoke BatchJob while another job is running") { @@ -819,7 +819,7 @@ await command.RespondEphemeralPingAsync( InstrumentationPerfmon.FailedCommandsThatWereUnknownExceptions.Increment(); - SystemLogger.Singleton.Error("[EID-{0}] An unexpected error occurred: {1}", exceptionId.ToString(), ex.ToDetailedString()); + Logger.Singleton.Error("[EID-{0}] An unexpected error occurred: {1}", exceptionId.ToString(), ex.ToDetailedString()); if (!global::MFDLabs.Grid.Bot.Properties.Settings.Default.CareToLeakSensitiveExceptions) { @@ -862,26 +862,26 @@ private static async Task HandleException(Exception ex, string alias, SocketMess switch (ex) { case CircuitBreakerException _: - SystemLogger.Singleton.Warning("CircuitBreakerException '{0}'", ex.ToDetailedString()); + Logger.Singleton.Warning("CircuitBreakerException '{0}'", ex.ToDetailedString()); await message.ReplyAsync(ex.Message); return; case NotSupportedException _: - SystemLogger.Singleton.Warning("This could have been a thread pool error, we'll assume that."); + Logger.Singleton.Warning("This could have been a thread pool error, we'll assume that."); return; case ApplicationException _: - SystemLogger.Singleton.Warning("Application threw an exception {0}", ex.ToDetailedString()); + Logger.Singleton.Warning("Application threw an exception {0}", ex.ToDetailedString()); await message.ReplyAsync($"The command threw an exception: {ex.Message}"); return; case TimeoutException _: InstrumentationPerfmon.FailedCommandsThatTimedOut.Increment(); - SystemLogger.Singleton.Error("The command '{0}' timed out. {1}", alias, ex.Message); + Logger.Singleton.Error("The command '{0}' timed out. {1}", alias, ex.Message); await message.ReplyAsync("the command you tried to execute has timed out, please try identify " + "the leading cause of a timeout."); return; case EndpointNotFoundException _: InstrumentationPerfmon.FailedCommandsThatTimedOut.Increment(); InstrumentationPerfmon.FailedCommandsThatTriedToAccessOfflineGridServer.Increment(); - SystemLogger.Singleton.Warning("The grid service was not online."); + Logger.Singleton.Warning("The grid service was not online."); await message.ReplyAsync($"the grid service is not currently running, please ask " + $"<@!{MFDLabs.Grid.Bot.Properties.Settings.Default.BotOwnerID}> to start " + $"the service."); @@ -889,7 +889,7 @@ await message.ReplyAsync($"the grid service is not currently running, please ask case FaultException fault: { InstrumentationPerfmon.FailedCommandsThatTriggeredAFaultException.Increment(); - SystemLogger.Singleton.Warning("An error occured on the grid server: {0}", fault.Message); + Logger.Singleton.Warning("An error occured on the grid server: {0}", fault.Message); switch (fault.Message) { @@ -932,7 +932,7 @@ await message.Channel.SendMessageAsync( InstrumentationPerfmon.FailedCommandsThatWereUnknownExceptions.Increment(); - SystemLogger.Singleton.Error("[EID-{0}] An unexpected error occurred: {1}", + Logger.Singleton.Error("[EID-{0}] An unexpected error occurred: {1}", exceptionId.ToString(), ex.ToDetailedString()); @@ -996,13 +996,13 @@ private static void ParseAndInsertIntoCommandRegistry() lock (StateSpecificCommandHandlers) { InstrumentationPerfmon.CommandsParsedAndInsertedIntoRegistry.Increment(); - SystemLogger.Singleton.LifecycleEvent("Begin attempt to register commands via Reflection"); + Logger.Singleton.LifecycleEvent("Begin attempt to register commands via Reflection"); try { var defaultCommandNamespace = GetDefaultCommandNamespace(); - SystemLogger.Singleton.Info("Got default command namespace '{0}'.", defaultCommandNamespace); + Logger.Singleton.Info("Got default command namespace '{0}'.", defaultCommandNamespace); var defaultCommandTypes = Assembly.GetExecutingAssembly().GetTypesInAssemblyNamespace(defaultCommandNamespace); @@ -1014,14 +1014,14 @@ private static void ParseAndInsertIntoCommandRegistry() { var slashCommandNamespace = GetSlashCommandNamespace(); - SystemLogger.Singleton.Info("Got slash command namespace '{0}'.", slashCommandNamespace); + Logger.Singleton.Info("Got slash command namespace '{0}'.", slashCommandNamespace); var slashCommandTypes = Assembly.GetExecutingAssembly().GetTypesInAssemblyNamespace(slashCommandNamespace); if (slashCommandTypes.Length == 0) { InstrumentationPerfmon.CommandNamespacesThatHadNoClasses.Increment(); - SystemLogger.Singleton.Warning("There were no slash commands found in the namespace '{0}'.", slashCommandNamespace); + Logger.Singleton.Warning("There were no slash commands found in the namespace '{0}'.", slashCommandNamespace); } else { @@ -1035,12 +1035,12 @@ private static void ParseAndInsertIntoCommandRegistry() if (commandHandler is not IStateSpecificSlashCommandHandler trueCommandHandler) continue; - SystemLogger.Singleton.Info("Parsing slash command '{0}'.", type.FullName); + Logger.Singleton.Info("Parsing slash command '{0}'.", type.FullName); if (trueCommandHandler.CommandAlias.IsNullOrEmpty()) { InstrumentationPerfmon.StateSpecificCommandsThatHadNoAliases.Increment(); - SystemLogger.Singleton.Error( + Logger.Singleton.Error( "Exception when reading '{0}': Expected the sizeof field 'CommandAlias' " + "to not be null or empty", type.FullName @@ -1052,7 +1052,7 @@ private static void ParseAndInsertIntoCommandRegistry() if (GetSlashCommandByCommandAlias(trueCommandHandler.CommandAlias) != null) { InstrumentationPerfmon.StateSpecificCommandAliasesThatAlreadyExisted.Increment(); - SystemLogger.Singleton.Error( + Logger.Singleton.Error( "Exception when reading '{0}': There is already an existing command with the alias of '{1}'", type.FullName, trueCommandHandler.CommandAlias @@ -1063,7 +1063,7 @@ private static void ParseAndInsertIntoCommandRegistry() if (trueCommandHandler.CommandDescription is { Length: 0 }) { InstrumentationPerfmon.StateSpecificCommandsThatHadNoNullButEmptyDescription.Increment(); - SystemLogger.Singleton.Error( + Logger.Singleton.Error( "Exception when reading '{0}': Expected field 'CommandDescription' " + "to have a size greater than 0", type.FullName @@ -1087,7 +1087,7 @@ private static void ParseAndInsertIntoCommandRegistry() if (guild == null) { - SystemLogger.Singleton.Trace( + Logger.Singleton.Trace( "Exception when reading '{0}': Unknown Guild '{1}'", type.FullName, trueCommandHandler.GuildId @@ -1114,7 +1114,7 @@ private static void ParseAndInsertIntoCommandRegistry() catch (Exception ex) { InstrumentationPerfmon.CommandRegistryRegistrationsThatFailed.Increment(); - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } } } @@ -1125,7 +1125,7 @@ private static void ParseAndInsertIntoCommandRegistry() if (defaultCommandTypes.Length == 0) { InstrumentationPerfmon.CommandNamespacesThatHadNoClasses.Increment(); - SystemLogger.Singleton.Warning("There were no default commands found in the namespace '{0}'.", + Logger.Singleton.Warning("There were no default commands found in the namespace '{0}'.", defaultCommandNamespace); } else @@ -1139,12 +1139,12 @@ private static void ParseAndInsertIntoCommandRegistry() var commandHandler = Activator.CreateInstance(type); if (commandHandler is IStateSpecificCommandHandler trueCommandHandler) { - SystemLogger.Singleton.Info("Parsing command '{0}'.", type.FullName); + Logger.Singleton.Info("Parsing command '{0}'.", type.FullName); if (trueCommandHandler.CommandAliases.Length < 1) { InstrumentationPerfmon.StateSpecificCommandsThatHadNoAliases.Increment(); - SystemLogger.Singleton.Trace( + Logger.Singleton.Trace( "Exception when reading '{0}': Expected the sizeof field " + "'CommandAliases' to be greater than 0, got {1}", type.FullName, @@ -1157,7 +1157,7 @@ private static void ParseAndInsertIntoCommandRegistry() if (trueCommandHandler.CommandName.IsNullOrEmpty()) { InstrumentationPerfmon.StateSpecificCommandsThatHadNoName.Increment(); - SystemLogger.Singleton.Trace( + Logger.Singleton.Trace( "Exception when reading '{0}': Expected field 'CommandName' to be not null", type.FullName ); @@ -1168,7 +1168,7 @@ private static void ParseAndInsertIntoCommandRegistry() if (trueCommandHandler.CommandDescription is { Length: 0 }) { InstrumentationPerfmon.StateSpecificCommandsThatHadNoNullButEmptyDescription.Increment(); - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "Exception when reading '{0}': Expected field " + "'CommandDescription' to have a size greater than 0", type.FullName @@ -1195,7 +1195,7 @@ private static void ParseAndInsertIntoCommandRegistry() catch (Exception ex) { InstrumentationPerfmon.CommandRegistryRegistrationsThatFailed.Increment(); - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } } } @@ -1204,11 +1204,11 @@ private static void ParseAndInsertIntoCommandRegistry() catch (Exception ex) { InstrumentationPerfmon.CommandRegistryRegistrationsThatFailed.Increment(); - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } finally { - SystemLogger.Singleton.Verbose("Successfully initialized the CommandRegistry."); + Logger.Singleton.Verbose("Successfully initialized the CommandRegistry."); } } } @@ -1255,24 +1255,24 @@ public static (Modes, CountersData) GetMetrics() public static void LogMetricsReport() { - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "Command Registry metrics report for Date ({0} at {1})", DateTimeGlobal.GetUtcNowAsIso(), LoggingSystem.GlobalLifetimeWatch.Elapsed.TotalSeconds.ToString("f7") ); - SystemLogger.Singleton.Log("====================================================================================="); - SystemLogger.Singleton.Log("Total command request count: {0}", Counters.RequestCountN); - SystemLogger.Singleton.Log("Total succeeded command request count: {0}", Counters.RequestSucceededCountN); - SystemLogger.Singleton.Log("Total failed command request count: {0}", Counters.RequestFailedCountN); + Logger.Singleton.Log("====================================================================================="); + Logger.Singleton.Log("Total command request count: {0}", Counters.RequestCountN); + Logger.Singleton.Log("Total succeeded command request count: {0}", Counters.RequestSucceededCountN); + Logger.Singleton.Log("Total failed command request count: {0}", Counters.RequestFailedCountN); var modes = CalculateModes(); - SystemLogger.Singleton.Log("Average request channel: '{0}' with average of {1}", modes.Channels.Item, modes.Channels.Average); - SystemLogger.Singleton.Log("Average request guild: '{0}' with average of {1}", modes.Servers.Item, modes.Servers.Average); - SystemLogger.Singleton.Log("Average request user: '{0}' with average of {1}", modes.Users.Item, modes.Users.Average); - SystemLogger.Singleton.Log("Average request command name: '{0}' with average of {1}", modes.Commands.Item, modes.Commands.Average); + Logger.Singleton.Log("Average request channel: '{0}' with average of {1}", modes.Channels.Item, modes.Channels.Average); + Logger.Singleton.Log("Average request guild: '{0}' with average of {1}", modes.Servers.Item, modes.Servers.Average); + Logger.Singleton.Log("Average request user: '{0}' with average of {1}", modes.Users.Item, modes.Users.Average); + Logger.Singleton.Log("Average request command name: '{0}' with average of {1}", modes.Commands.Item, modes.Commands.Average); - SystemLogger.Singleton.Log("====================================================================================="); + Logger.Singleton.Log("====================================================================================="); } private static void InsertIntoAverages(string channelName, string serverName, string userName, string commandName) diff --git a/Shared/MFDLabs.GridCommands/Commands/GetAllSettingsOfAssembly.cs b/Shared/MFDLabs.GridCommands/Commands/GetAllSettingsOfAssembly.cs index dbbddd90..de9f69de 100644 --- a/Shared/MFDLabs.GridCommands/Commands/GetAllSettingsOfAssembly.cs +++ b/Shared/MFDLabs.GridCommands/Commands/GetAllSettingsOfAssembly.cs @@ -48,7 +48,7 @@ public async Task Invoke(string[] messageContentArray, SocketMessage message, st if (assemblyName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null assembly name, aborting."); + Logger.Singleton.Warning("Null assembly name, aborting."); await message.ReplyAsync("The first parameter of the command was null, expected the " + "\"AssemblyName\" to be not null or not empty."); return; @@ -58,7 +58,7 @@ await message.ReplyAsync("The first parameter of the command was null, expected if (settingsGroupName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null setting group name, aborting."); + Logger.Singleton.Warning("Null setting group name, aborting."); await message.ReplyAsync("The second parameter of the command was null, expected the " + "\"SettingsGroupName\" to be not null or not empty."); return; @@ -72,14 +72,14 @@ await message.ReplyAsync("The second parameter of the command was null, expected } catch (FileNotFoundException) { - SystemLogger.Singleton.Warning("Could not find the assembly '{0}', aborting.", assemblyName); + Logger.Singleton.Warning("Could not find the assembly '{0}', aborting.", assemblyName); await message.ReplyAsync($"Could not find the assembly by the name of '{assemblyName}'." + $"Please check to make sure you spelled it correctly! (CaSe-SeNsItIvE)"); return; } catch (TypeLoadException) { - SystemLogger.Singleton.Warning("Could not find the type '{0}' in the assembly '{1}', aborting.", + Logger.Singleton.Warning("Could not find the type '{0}' in the assembly '{1}', aborting.", settingsGroupName, assemblyName); await message.ReplyAsync($"Could not find the type by the name of '{settingsGroupName}' in " + @@ -89,7 +89,7 @@ await message.ReplyAsync($"Could not find the type by the name of '{settingsGrou if (remoteSettings.BaseType != typeof(ApplicationSettingsBase)) { - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "The type '{0}' in the assembly '{1}' did not extend the type '{2}', aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName, @@ -105,7 +105,7 @@ await message.ReplyAsync($"The type '{remoteSettings.FullName}' in the assembly" if (settingsInstance == null) { - SystemLogger.Singleton.Warning("The property 'Default' on the type '{0}' in the assembly '{1}'" + + Logger.Singleton.Warning("The property 'Default' on the type '{0}' in the assembly '{1}'" + "was null, aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName); diff --git a/Shared/MFDLabs.GridCommands/Commands/GetSetting.cs b/Shared/MFDLabs.GridCommands/Commands/GetSetting.cs index 4beba5eb..c71be981 100644 --- a/Shared/MFDLabs.GridCommands/Commands/GetSetting.cs +++ b/Shared/MFDLabs.GridCommands/Commands/GetSetting.cs @@ -37,7 +37,7 @@ public async Task Invoke(string[] messageContentArray, SocketMessage message, st if (settingName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null Setting name, aborting."); + Logger.Singleton.Warning("Null Setting name, aborting."); await message.ReplyAsync("The first parameter of the command was null, expected " + "the \"SettingName\" to be not null or not empty."); return; @@ -51,7 +51,7 @@ await message.ReplyAsync("The first parameter of the command was null, expected } catch (SettingsPropertyNotFoundException ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); await message.ReplyAsync(ex.Message); return; } diff --git a/Shared/MFDLabs.GridCommands/Commands/GetSettingOfAssembly.cs b/Shared/MFDLabs.GridCommands/Commands/GetSettingOfAssembly.cs index 66d88100..471b1829 100644 --- a/Shared/MFDLabs.GridCommands/Commands/GetSettingOfAssembly.cs +++ b/Shared/MFDLabs.GridCommands/Commands/GetSettingOfAssembly.cs @@ -34,7 +34,7 @@ public async Task Invoke(string[] messageContentArray, SocketMessage message, st if (assemblyName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null assembly name, aborting."); + Logger.Singleton.Warning("Null assembly name, aborting."); await message.ReplyAsync("The first parameter of the command was null, " + "expected the \"AssemblyName\" to be not null or not empty."); return; @@ -44,7 +44,7 @@ await message.ReplyAsync("The first parameter of the command was null, " + if (settingsGroupName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null setting group name, aborting."); + Logger.Singleton.Warning("Null setting group name, aborting."); await message.ReplyAsync("The second parameter of the command was null, " + "expected the \"SettingsGroupName\" to be not null or not empty."); return; @@ -58,14 +58,14 @@ await message.ReplyAsync("The second parameter of the command was null, " + } catch (FileNotFoundException) { - SystemLogger.Singleton.Warning("Could not find the assembly '{0}', aborting.", assemblyName); + Logger.Singleton.Warning("Could not find the assembly '{0}', aborting.", assemblyName); await message.ReplyAsync($"Could not find the assembly by the name of '{assemblyName}'." + $" Please check to make sure you spelled it correctly! (CaSe-SeNsItIvE)"); return; } catch (TypeLoadException) { - SystemLogger.Singleton.Warning("Could not find the type '{0}' in the assembly '{1}', aborting.", settingsGroupName, assemblyName); + Logger.Singleton.Warning("Could not find the type '{0}' in the assembly '{1}', aborting.", settingsGroupName, assemblyName); await message.ReplyAsync($"Could not find the type by the name of '{settingsGroupName}' " + $"in the assembly '{assemblyName}'. Please check to make sure you spelled " + $"it correctly! (CaSe-SeNsItIvE)"); @@ -74,7 +74,7 @@ await message.ReplyAsync($"Could not find the type by the name of '{settingsGrou if (remoteSettings.BaseType != typeof(ApplicationSettingsBase)) { - SystemLogger.Singleton.Warning("The type '{0}' in the assembly '{1}' did not extend the type '{2}'," + + Logger.Singleton.Warning("The type '{0}' in the assembly '{1}' did not extend the type '{2}'," + " aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName, @@ -90,7 +90,7 @@ await message.ReplyAsync($"The type '{remoteSettings.FullName}' in the assembly if (settingsInstance == null) { - SystemLogger.Singleton.Warning("The property 'Default' on the type '{0}' in the assembly '{1}' " + + Logger.Singleton.Warning("The property 'Default' on the type '{0}' in the assembly '{1}' " + "was null, aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName); @@ -106,7 +106,7 @@ await message.ReplyAsync($"The property 'Default' on the type '{remoteSettings.F if (settingName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null Setting name, aborting."); + Logger.Singleton.Warning("Null Setting name, aborting."); await message.ReplyAsync("The third parameter of the command was null, expected the \"SettingName\"" + "to be not null or not empty."); return; @@ -122,7 +122,7 @@ await message.ReplyAsync("The third parameter of the command was null, expected if (indexer == null) { - SystemLogger.Singleton.Warning("The indexer for the property '{0}' on the type '{1}' in the" + + Logger.Singleton.Warning("The indexer for the property '{0}' on the type '{1}' in the" + "assembly '{2}' was null, aborting.", settingName, remoteSettings.FullName, @@ -141,14 +141,14 @@ await message.ReplyAsync("The third parameter of the command was null, expected { if (tEx.InnerException is SettingsPropertyNotFoundException ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); await message.ReplyAsync($"Could not find the setting '{settingName}' in the setting " + $"group '{remoteSettings.FullName}' in the" + $" assembly '{remoteSettings.Assembly.GetName().Name}'"); return; } - SystemLogger.Singleton.Warning(tEx.Message); + Logger.Singleton.Warning(tEx.Message); await message.ReplyAsync("Unknown exception occurred when getting setting."); return; } diff --git a/Shared/MFDLabs.GridCommands/Commands/LogFile.cs b/Shared/MFDLabs.GridCommands/Commands/LogFile.cs index 473c1bf2..93ed22b5 100644 --- a/Shared/MFDLabs.GridCommands/Commands/LogFile.cs +++ b/Shared/MFDLabs.GridCommands/Commands/LogFile.cs @@ -18,7 +18,7 @@ internal sealed class LogFile : IStateSpecificCommandHandler public async Task Invoke(string[] messageContentArray, SocketMessage message, string originalCommand) { await message.ReplyAsync( - $"The log file name for this instance is: `{SystemLogger.FileName}`\n" + + $"The log file name for this instance is: `{Logger.Singleton.FileName}`\n" + "Please paste this into the `Log File Name` field in grid-bot-support templates so that the internal team can easily identify this instance's log files." ); } diff --git a/Shared/MFDLabs.GridCommands/Commands/ReloadSettingsOfAssembly.cs b/Shared/MFDLabs.GridCommands/Commands/ReloadSettingsOfAssembly.cs index a945e477..6730f83b 100644 --- a/Shared/MFDLabs.GridCommands/Commands/ReloadSettingsOfAssembly.cs +++ b/Shared/MFDLabs.GridCommands/Commands/ReloadSettingsOfAssembly.cs @@ -31,7 +31,7 @@ public async Task Invoke(string[] messageContentArray, SocketMessage message, st if (assemblyName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null assembly name, aborting."); + Logger.Singleton.Warning("Null assembly name, aborting."); await message.ReplyAsync("The first parameter of the command was null, " + "expected the \"AssemblyName\" to be not null or not empty."); return; @@ -41,7 +41,7 @@ await message.ReplyAsync("The first parameter of the command was null, " + if (settingsGroupName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null setting group name, aborting."); + Logger.Singleton.Warning("Null setting group name, aborting."); await message.ReplyAsync("The second parameter of the command was null," + "expected the \"SettingsGroupName\" to be not null or not empty."); return; @@ -55,7 +55,7 @@ await message.ReplyAsync("The second parameter of the command was null," + } catch (FileNotFoundException) { - SystemLogger.Singleton.Warning("Could not find the assembly '{0}', aborting.", assemblyName); + Logger.Singleton.Warning("Could not find the assembly '{0}', aborting.", assemblyName); await message.ReplyAsync($"Could not find the assembly by the name of" + $"'{assemblyName}'. Please check to make sure you spelled " + $"it correctly! (CaSe-SeNsItIvE)"); @@ -63,7 +63,7 @@ await message.ReplyAsync($"Could not find the assembly by the name of" + } catch (TypeLoadException) { - SystemLogger.Singleton.Warning("Could not find the type '{0}' in the assembly '{1}', aborting.", settingsGroupName, assemblyName); + Logger.Singleton.Warning("Could not find the type '{0}' in the assembly '{1}', aborting.", settingsGroupName, assemblyName); await message.ReplyAsync($"Could not find the type by the name of" + $"'{settingsGroupName}' in the assembly '{assemblyName}'. " + $"Please check to make sure you spelled it correctly! (CaSe-SeNsItIvE)"); @@ -72,7 +72,7 @@ await message.ReplyAsync($"Could not find the type by the name of" + if (remoteSettings.BaseType != typeof(ApplicationSettingsBase)) { - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "The type '{0}' in the assembly '{1}' did not extend the type '{2}', aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName, @@ -88,7 +88,7 @@ await message.ReplyAsync($"The type '{remoteSettings.FullName}' in the" + if (settingsInstance == null) { - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "The property 'Default' on the type '{0}' in the assembly '{1}' was null, aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName); @@ -105,7 +105,7 @@ await message.ReplyAsync($"The property 'Default' on the type '{remoteSettings.F if (reload == null) { - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "The 'Reload' method on the type '{0}' in the assembly '{1}' was not present, aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName); diff --git a/Shared/MFDLabs.GridCommands/Commands/UpdateSetting.cs b/Shared/MFDLabs.GridCommands/Commands/UpdateSetting.cs index 4f15ae0e..5418a5bf 100644 --- a/Shared/MFDLabs.GridCommands/Commands/UpdateSetting.cs +++ b/Shared/MFDLabs.GridCommands/Commands/UpdateSetting.cs @@ -31,7 +31,7 @@ public async Task Invoke(string[] messageContentArray, SocketMessage message, st if (settingName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null Setting name, aborting."); + Logger.Singleton.Warning("Null Setting name, aborting."); await message.ReplyAsync("The first parameter of the command was null, expected " + "the \"SettingName\" to be not null or not empty."); return; @@ -43,7 +43,7 @@ await message.ReplyAsync("The first parameter of the command was null, expected { if (!global::MFDLabs.Grid.Bot.Properties.Settings.Default.AllowNullsWhenUpdatingSetting) { - SystemLogger.Singleton.Warning("The environment does not allow nulls."); + Logger.Singleton.Warning("The environment does not allow nulls."); await message.ReplyAsync("The setting 'AllowNullsWhenUpdatingSetting' is disabled, " + "please supply a 'non-nullable' value."); return; @@ -60,7 +60,7 @@ await message.ReplyAsync("The setting 'AllowNullsWhenUpdatingSetting' is disable } catch (SettingsPropertyNotFoundException ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); await message.ReplyAsync(ex.Message); return; } @@ -91,7 +91,7 @@ await message.ReplyAsync("The setting 'AllowNullsWhenUpdatingSetting' is disable } catch (Exception ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); switch (ex) { @@ -116,7 +116,7 @@ await message.ReplyAsync("The typeof your setting value could not be casted to t { global::MFDLabs.Grid.Bot.Properties.Settings.Default[settingName] = transformedValue; global::MFDLabs.Grid.Bot.Properties.Settings.Default.Save(); - SystemLogger.Singleton.LifecycleEvent("Successfully set the setting " + + Logger.Singleton.LifecycleEvent("Successfully set the setting " + "'{0}' to the value of '{1}'.", settingName, // ReSharper disable once PossibleInvalidOperationException @@ -129,7 +129,7 @@ await message.ReplyAsync($"Successfully set the setting '{settingName}' to the" } catch (SettingsPropertyIsReadOnlyException ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); await message.ReplyAsync(ex.Message); } } diff --git a/Shared/MFDLabs.GridCommands/Commands/UpdateSettingOfAssembly.cs b/Shared/MFDLabs.GridCommands/Commands/UpdateSettingOfAssembly.cs index fb236b3a..e93832c2 100644 --- a/Shared/MFDLabs.GridCommands/Commands/UpdateSettingOfAssembly.cs +++ b/Shared/MFDLabs.GridCommands/Commands/UpdateSettingOfAssembly.cs @@ -34,7 +34,7 @@ public async Task Invoke(string[] messageContentArray, SocketMessage message, st if (assemblyName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null assembly name, aborting."); + Logger.Singleton.Warning("Null assembly name, aborting."); await message.ReplyAsync("The first parameter of the command was null, " + "expected the \"AssemblyName\" to be not null or not empty."); return; @@ -44,7 +44,7 @@ await message.ReplyAsync("The first parameter of the command was null, " + if (settingsGroupName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null setting group name, aborting."); + Logger.Singleton.Warning("Null setting group name, aborting."); await message.ReplyAsync("The second parameter of the command was null, " + "expected the \"SettingsGroupName\" to be not null or not empty."); return; @@ -58,14 +58,14 @@ await message.ReplyAsync("The second parameter of the command was null, " + } catch (FileNotFoundException) { - SystemLogger.Singleton.Warning("Could not find the assembly '{0}', aborting.", assemblyName); + Logger.Singleton.Warning("Could not find the assembly '{0}', aborting.", assemblyName); await message.ReplyAsync($"Could not find the assembly by the name of " + $"'{assemblyName}'. Please check to make sure you spelled it correctly! (CaSe-SeNsItIvE)"); return; } catch (TypeLoadException) { - SystemLogger.Singleton.Warning("Could not find the type '{0}' in the assembly '{1}', aborting.", settingsGroupName, assemblyName); + Logger.Singleton.Warning("Could not find the type '{0}' in the assembly '{1}', aborting.", settingsGroupName, assemblyName); await message.ReplyAsync($"Could not find the type by the name of " + $"'{settingsGroupName}' in the assembly '{assemblyName}'. " + $"Please check to make sure you spelled it correctly! (CaSe-SeNsItIvE)"); @@ -74,7 +74,7 @@ await message.ReplyAsync($"Could not find the type by the name of " + if (remoteSettings.BaseType != typeof(ApplicationSettingsBase)) { - SystemLogger.Singleton.Warning("The type '{0}' in the assembly '{1}' " + + Logger.Singleton.Warning("The type '{0}' in the assembly '{1}' " + "did not extend the type '{2}', aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName, @@ -90,7 +90,7 @@ await message.ReplyAsync($"The type '{remoteSettings.FullName}' " + if (settingsInstance == null) { - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "The property 'Default' on the type '{0}' in the assembly '{1}' was null, aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName); @@ -106,7 +106,7 @@ await message.ReplyAsync($"The property 'Default' on the type '{remoteSettings.F if (settingName.IsNullOrEmpty()) { - SystemLogger.Singleton.Warning("Null Setting name, aborting."); + Logger.Singleton.Warning("Null Setting name, aborting."); await message.ReplyAsync("The third parameter of the command was null, " + "expected the \"SettingName\" to be not null or not empty."); return; @@ -120,7 +120,7 @@ await message.ReplyAsync("The third parameter of the command was null, " + { if (!global::MFDLabs.Grid.Bot.Properties.Settings.Default.AllowNullsWhenUpdatingSetting) { - SystemLogger.Singleton.Warning("The environment does not allow nulls."); + Logger.Singleton.Warning("The environment does not allow nulls."); await message.ReplyAsync("The setting 'AllowNullsWhenUpdatingSetting' is " + "disabled, please supply a 'non-nullable' value."); return; @@ -139,7 +139,7 @@ await message.ReplyAsync("The setting 'AllowNullsWhenUpdatingSetting' is " + if (indexer == null) { - SystemLogger.Singleton.Warning("The indexer for the property '{0}' on the" + + Logger.Singleton.Warning("The indexer for the property '{0}' on the" + " type '{1}' in the assembly '{2}' was null, aborting.", settingName, remoteSettings.FullName, @@ -158,14 +158,14 @@ await message.ReplyAsync("The setting 'AllowNullsWhenUpdatingSetting' is " + { if (tEx.InnerException is SettingsPropertyNotFoundException ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); await message.ReplyAsync($"Could not find the setting '{settingName}' " + $"in the setting group '{remoteSettings.FullName}' in " + $"the assembly '{remoteSettings.Assembly.GetName().Name}'"); return; } - SystemLogger.Singleton.Warning(tEx.Message); + Logger.Singleton.Warning(tEx.Message); await message.ReplyAsync("Unknown exception occurred when updating setting."); return; } @@ -196,7 +196,7 @@ await message.ReplyAsync($"Could not find the setting '{settingName}' " + } catch (Exception ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); if (ex is ArgumentNullException || ex is ArgumentException) { @@ -223,7 +223,7 @@ await message.ReplyAsync($"The typeof your setting value could not be casted to } catch (SettingsPropertyIsReadOnlyException ex) { - SystemLogger.Singleton.Warning(ex.Message); + Logger.Singleton.Warning(ex.Message); await message.ReplyAsync(ex.Message); return; } @@ -232,7 +232,7 @@ await message.ReplyAsync($"The typeof your setting value could not be casted to if (saveInvoker == null) { - SystemLogger.Singleton.Warning("The 'Save' method on the type '{0}' in the assembly '{1}'" + + Logger.Singleton.Warning("The 'Save' method on the type '{0}' in the assembly '{1}'" + " was not present, aborting.", remoteSettings.FullName, remoteSettings.Assembly.FullName); @@ -243,7 +243,7 @@ await message.ReplyAsync($"The 'Save' method on the type '{remoteSettings.FullNa } saveInvoker.Invoke(settingInstanceValue, null); - SystemLogger.Singleton.LifecycleEvent("Successfully set the setting '{0}' to the value of '{1}' " + + Logger.Singleton.LifecycleEvent("Successfully set the setting '{0}' to the value of '{1}' " + "in the settings group '{2}' in the assembly '{3}'.", settingName, // ReSharper disable once PossibleInvalidOperationException diff --git a/Shared/MFDLabs.GridCommands/SlashCommands/LogFile.cs b/Shared/MFDLabs.GridCommands/SlashCommands/LogFile.cs index 5c014ca9..aaebe36b 100644 --- a/Shared/MFDLabs.GridCommands/SlashCommands/LogFile.cs +++ b/Shared/MFDLabs.GridCommands/SlashCommands/LogFile.cs @@ -24,7 +24,7 @@ public async Task Invoke(SocketSlashCommand command) using (await command.DeferEphemeralAsync()) { await command.RespondEphemeralAsync( - $"The log file name for this instance is: `{SystemLogger.FileName}`\n" + + $"The log file name for this instance is: `{Logger.Singleton.FileName}`\n" + "Please paste this into the `Log File Name` field in grid-bot-support templates so that the internal team can easily identify this instance's log files." ); } diff --git a/Shared/MFDLabs.GridDiagnostics/PerformanceServer.cs b/Shared/MFDLabs.GridDiagnostics/PerformanceServer.cs index b49e6532..8934fbd9 100644 --- a/Shared/MFDLabs.GridDiagnostics/PerformanceServer.cs +++ b/Shared/MFDLabs.GridDiagnostics/PerformanceServer.cs @@ -27,9 +27,9 @@ public static class PerformanceServer if (ex is not HttpListenerException {ErrorCode: 0x3E3}) { #if DEBUG || DEBUG_LOGGING_IN_PROD - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); #else - SystemLogger.Singleton.Warning("An error occurred on the perfmon counter server, please review this error message: {0}.", ex.Message); + Logger.Singleton.Warning("An error occurred on the perfmon counter server, please review this error message: {0}.", ex.Message); #endif } } @@ -37,32 +37,32 @@ public static class PerformanceServer public static void Start() { - SystemLogger.Singleton.LifecycleEvent("Launching performance monitor server..."); + Logger.Singleton.LifecycleEvent("Launching performance monitor server..."); #if !DEBUG if (!SystemGlobal.ContextIsAdministrator()) { - SystemLogger.Singleton.Warning("Not launching performance monitor service due to context accessibility issues."); + Logger.Singleton.Warning("Not launching performance monitor service due to context accessibility issues."); return; } #endif Server.Start(); - SystemLogger.Singleton.Warning("Launched performance monitor server on host 'http://*:{0}'.", + Logger.Singleton.Warning("Launched performance monitor server on host 'http://*:{0}'.", global::MFDLabs.Grid.Bot.Properties.Settings.Default.CounterServerPort); } public static void Stop() { - SystemLogger.Singleton.LifecycleEvent("Stopping performance monitor server on host 'http://*:{0}'...", global::MFDLabs.Grid.Bot.Properties.Settings.Default.CounterServerPort); + Logger.Singleton.LifecycleEvent("Stopping performance monitor server on host 'http://*:{0}'...", global::MFDLabs.Grid.Bot.Properties.Settings.Default.CounterServerPort); #if !DEBUG if (!SystemGlobal.ContextIsAdministrator()) { - SystemLogger.Singleton.Warning("Not stopping performance monitor service due to context accessibility issues."); + Logger.Singleton.Warning("Not stopping performance monitor service due to context accessibility issues."); return; } @@ -77,7 +77,7 @@ public static void Stop() // ignored } - SystemLogger.Singleton.Warning("Stopped performance monitor server on port {0}.", global::MFDLabs.Grid.Bot.Properties.Settings.Default.CounterServerPort); + Logger.Singleton.Warning("Stopped performance monitor server on port {0}.", global::MFDLabs.Grid.Bot.Properties.Settings.Default.CounterServerPort); } } } diff --git a/Shared/MFDLabs.GridEvents/Events/OnConnected.cs b/Shared/MFDLabs.GridEvents/Events/OnConnected.cs index 98b372b8..88a5d473 100644 --- a/Shared/MFDLabs.GridEvents/Events/OnConnected.cs +++ b/Shared/MFDLabs.GridEvents/Events/OnConnected.cs @@ -13,7 +13,7 @@ public static class OnShardConnected { public static Task Invoke(DiscordSocketClient shard) { - SystemLogger.Singleton.Debug("Shard '{0}' has been connected to the Hub.", shard.ShardId); + Logger.Singleton.Debug("Shard '{0}' has been connected to the Hub.", shard.ShardId); return Task.CompletedTask; } } @@ -22,7 +22,7 @@ public static class OnConnected { public static Task Invoke() { - SystemLogger.Singleton.Debug("Client has been connected to the Hub."); + Logger.Singleton.Debug("Client has been connected to the Hub."); return Task.CompletedTask; } } diff --git a/Shared/MFDLabs.GridEvents/Events/OnDisconnected.cs b/Shared/MFDLabs.GridEvents/Events/OnDisconnected.cs index 5ebbd69d..9c658e5d 100644 --- a/Shared/MFDLabs.GridEvents/Events/OnDisconnected.cs +++ b/Shared/MFDLabs.GridEvents/Events/OnDisconnected.cs @@ -13,7 +13,7 @@ public static Task Invoke(Exception ex) { #if DEBUG || DEBUG_LOGGING_IN_PROD if (!(ex is TaskCanceledException && !global::MFDLabs.Grid.Bot.Properties.Settings.Default.DebugAllowTaskCanceledExceptions)) - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); #endif return Task.CompletedTask; } diff --git a/Shared/MFDLabs.GridEvents/Events/OnLatencyUpdated.cs b/Shared/MFDLabs.GridEvents/Events/OnLatencyUpdated.cs index b26ece4e..57040f71 100644 --- a/Shared/MFDLabs.GridEvents/Events/OnLatencyUpdated.cs +++ b/Shared/MFDLabs.GridEvents/Events/OnLatencyUpdated.cs @@ -20,7 +20,7 @@ await GoogleAnalyticsManager.TrackNetworkEventAsync("KeepAlive", "LatencyUpdate", $"Received a latency update from the discord socket, old latency '{oldLatency}', new latency '{newLatency}'."); #if DEBUG || DEBUG_LOGGING_IN_PROD - SystemLogger.Singleton.Info( + Logger.Singleton.Info( "Received a latency update from the discord socket, old latency '{0}', new latency '{1}'.", oldLatency, newLatency); @@ -36,7 +36,7 @@ await GoogleAnalyticsManager.TrackNetworkEventAsync("KeepAlive", "LatencyUpdate", $"Received a latency update from the discord socket, old latency '{oldLatency}', new latency '{newLatency}'."); #if DEBUG || DEBUG_LOGGING_IN_PROD - SystemLogger.Singleton.Info( + Logger.Singleton.Info( "Received a latency update from the discord socket, old latency '{0}', new latency '{1}'.", oldLatency, newLatency); diff --git a/Shared/MFDLabs.GridEvents/Events/OnLogMessage.cs b/Shared/MFDLabs.GridEvents/Events/OnLogMessage.cs index d502b4ac..01d7f6fc 100644 --- a/Shared/MFDLabs.GridEvents/Events/OnLogMessage.cs +++ b/Shared/MFDLabs.GridEvents/Events/OnLogMessage.cs @@ -18,7 +18,7 @@ public static Task Invoke(LogMessage message) #if DEBUG || DEBUG_LOGGING_IN_PROD if (!(message.Exception is TaskCanceledException && !global::MFDLabs.Grid.Bot.Properties.Settings.Default.DebugAllowTaskCanceledExceptions)) - SystemLogger.Singleton.Error("DiscordInternal-EXCEPTION-{0}: {1} {2}", + Logger.Singleton.Error("DiscordInternal-EXCEPTION-{0}: {1} {2}", message.Source, message.Message, message.Exception.ToDetailedString()); @@ -32,19 +32,19 @@ public static Task Invoke(LogMessage message) switch (message) { case {Severity: LogSeverity.Warning}: - SystemLogger.Singleton.Warning("DiscordInternal-WARNING-{0}: {1}", message.Source, message.Message); + Logger.Singleton.Warning("DiscordInternal-WARNING-{0}: {1}", message.Source, message.Message); break; case {Severity: LogSeverity.Debug}: - SystemLogger.Singleton.Debug("DiscordInternal-DEBUG-{0}: {1}", message.Source, message.Message); + Logger.Singleton.Debug("DiscordInternal-DEBUG-{0}: {1}", message.Source, message.Message); break; case {Severity: LogSeverity.Info}: - SystemLogger.Singleton.Info("DiscordInternal-INFO-{0}: {1}", message.Source, message.Message); + Logger.Singleton.Info("DiscordInternal-INFO-{0}: {1}", message.Source, message.Message); break; case {Severity: LogSeverity.Verbose}: - SystemLogger.Singleton.Verbose("DiscordInternal-VERBOSE-{0}: {1}", message.Source, message.Message); + Logger.Singleton.Verbose("DiscordInternal-VERBOSE-{0}: {1}", message.Source, message.Message); break; case {Severity: LogSeverity.Error | LogSeverity.Critical}: - SystemLogger.Singleton.Error("DiscordInternal-ERROR-{0}: {1}", message.Source, message.Message); + Logger.Singleton.Error("DiscordInternal-ERROR-{0}: {1}", message.Source, message.Message); break; case {Severity: LogSeverity.Critical}: break; diff --git a/Shared/MFDLabs.GridEvents/Events/OnLoggedIn.cs b/Shared/MFDLabs.GridEvents/Events/OnLoggedIn.cs index ad1082bc..5a18f439 100644 --- a/Shared/MFDLabs.GridEvents/Events/OnLoggedIn.cs +++ b/Shared/MFDLabs.GridEvents/Events/OnLoggedIn.cs @@ -7,7 +7,7 @@ public static class OnLoggedIn { public static Task Invoke() { - SystemLogger.Singleton.Debug("BotGlobal logged in."); + Logger.Singleton.Debug("BotGlobal logged in."); return Task.CompletedTask; } } diff --git a/Shared/MFDLabs.GridEvents/Events/OnLoggedOut.cs b/Shared/MFDLabs.GridEvents/Events/OnLoggedOut.cs index 5ede71f7..45cea4eb 100644 --- a/Shared/MFDLabs.GridEvents/Events/OnLoggedOut.cs +++ b/Shared/MFDLabs.GridEvents/Events/OnLoggedOut.cs @@ -7,7 +7,7 @@ public static class OnLoggedOut { public static Task Invoke() { - SystemLogger.Singleton.Debug("BotGlobal logged out."); + Logger.Singleton.Debug("BotGlobal logged out."); return Task.CompletedTask; } } diff --git a/Shared/MFDLabs.GridEvents/Events/OnReady.cs b/Shared/MFDLabs.GridEvents/Events/OnReady.cs index 3fb5d5d1..7c5cf84c 100644 --- a/Shared/MFDLabs.GridEvents/Events/OnReady.cs +++ b/Shared/MFDLabs.GridEvents/Events/OnReady.cs @@ -25,7 +25,7 @@ public static async Task Invoke(DiscordSocketClient shard) if (global::MFDLabs.Grid.Bot.Properties.Settings.Default.RegisterCommandRegistryAtAppStart) CommandRegistry.RegisterOnce(); - SystemLogger.Singleton.Debug( + Logger.Singleton.Debug( "Shard '{0}' ready as '{0}#{1}'", shard.ShardId, BotGlobal.Client.CurrentUser.Username, @@ -66,7 +66,7 @@ public static async Task Invoke() if (global::MFDLabs.Grid.Bot.Properties.Settings.Default.RegisterCommandRegistryAtAppStart) CommandRegistry.RegisterOnce(); - SystemLogger.Singleton.Debug( + Logger.Singleton.Debug( "Bot ready as '{0}#{1}'", BotGlobal.Client.CurrentUser.Username, BotGlobal.Client.CurrentUser.Discriminator diff --git a/Shared/MFDLabs.GridEvents/WorkQueues/OnMessageReceivedWorkQueue.cs b/Shared/MFDLabs.GridEvents/WorkQueues/OnMessageReceivedWorkQueue.cs index dd653fee..d22dc99d 100644 --- a/Shared/MFDLabs.GridEvents/WorkQueues/OnMessageReceivedWorkQueue.cs +++ b/Shared/MFDLabs.GridEvents/WorkQueues/OnMessageReceivedWorkQueue.cs @@ -49,7 +49,7 @@ private static async void OnReceive(SocketMessage message, SuccessFailurePort re { if (!userIsAdmin && !userIsPrivilaged) { - SystemLogger.Singleton.Warning("Maintenance enabled, and someone tried to use it!!"); + Logger.Singleton.Warning("Maintenance enabled, and someone tried to use it!!"); var failureMessage = global::MFDLabs.Grid.Bot.Properties.Settings.Default.ReasonForDying; @@ -62,7 +62,7 @@ private static async void OnReceive(SocketMessage message, SuccessFailurePort re if (userIsBlacklisted) { await message.Author.FireEventAsync("Fatality", "They tried to use the bot while blacklisted"); - SystemLogger.Singleton.Warning("A blacklisted user {0}('{1}#{2}') tried to use the bot, attempt to DM that they are blacklisted.", message.Author.Id, message.Author.Username, message.Author.Discriminator); + Logger.Singleton.Warning("A blacklisted user {0}('{1}#{2}') tried to use the bot, attempt to DM that they are blacklisted.", message.Author.Id, message.Author.Username, message.Author.Discriminator); try { @@ -70,7 +70,7 @@ private static async void OnReceive(SocketMessage message, SuccessFailurePort re } catch { - SystemLogger.Singleton.Warning("We tried to DM the user, but their DMs may not be available."); + Logger.Singleton.Warning("We tried to DM the user, but their DMs may not be available."); } return; diff --git a/Shared/MFDLabs.GridEvents/WorkQueues/OnSlashCommandReceivedWorkQueue.cs b/Shared/MFDLabs.GridEvents/WorkQueues/OnSlashCommandReceivedWorkQueue.cs index 2fd20c50..36bffd66 100644 --- a/Shared/MFDLabs.GridEvents/WorkQueues/OnSlashCommandReceivedWorkQueue.cs +++ b/Shared/MFDLabs.GridEvents/WorkQueues/OnSlashCommandReceivedWorkQueue.cs @@ -41,7 +41,7 @@ private static async void OnReceive(SocketSlashCommand command, SuccessFailurePo { if (!userIsAdmin && !userIsPrivilaged) { - SystemLogger.Singleton.Warning("Maintenance enabled, and someone tried to use it!!"); + Logger.Singleton.Warning("Maintenance enabled, and someone tried to use it!!"); var failureMessage = global::MFDLabs.Grid.Bot.Properties.Settings.Default.ReasonForDying; @@ -53,7 +53,7 @@ private static async void OnReceive(SocketSlashCommand command, SuccessFailurePo if (userIsBlacklisted) { - SystemLogger.Singleton.Warning("A blacklisted user {0}('{1}#{2}') tried to use the bot, attempt to DM that they are blacklisted.", command.User.Id, command.User.Username, command.User.Discriminator); + Logger.Singleton.Warning("A blacklisted user {0}('{1}#{2}') tried to use the bot, attempt to DM that they are blacklisted.", command.User.Id, command.User.Username, command.User.Discriminator); try { @@ -61,7 +61,7 @@ private static async void OnReceive(SocketSlashCommand command, SuccessFailurePo } catch { - SystemLogger.Singleton.Warning("We tried to DM the user, but their DMs may not be available."); + Logger.Singleton.Warning("We tried to DM the user, but their DMs may not be available."); } return; diff --git a/Shared/MFDLabs.GridGlobal/BotGlobal.cs b/Shared/MFDLabs.GridGlobal/BotGlobal.cs index 40ce6ed0..348c361a 100644 --- a/Shared/MFDLabs.GridGlobal/BotGlobal.cs +++ b/Shared/MFDLabs.GridGlobal/BotGlobal.cs @@ -25,7 +25,7 @@ public static async Task SingletonLaunch() public static async Task TryLogout() { - SystemLogger.Singleton.Log("Attempting to logout bot user..."); + Logger.Singleton.Log("Attempting to logout bot user..."); if (Client != null) { @@ -33,11 +33,11 @@ public static async Task TryLogout() { await Client.StopAsync().ConfigureAwait(false); //await _client.LogoutAsync().ConfigureAwait(false); - SystemLogger.Singleton.Info("Bot successfully logged out and stopped!"); + Logger.Singleton.Info("Bot successfully logged out and stopped!"); } catch { - SystemLogger.Singleton.Warning("Failed to log out bot user, most likely wasn't logged in prior."); + Logger.Singleton.Warning("Failed to log out bot user, most likely wasn't logged in prior."); } } } diff --git a/Shared/MFDLabs.GridHooks/ConsoleHookRegistry.cs b/Shared/MFDLabs.GridHooks/ConsoleHookRegistry.cs index bb905481..b608b286 100644 --- a/Shared/MFDLabs.GridHooks/ConsoleHookRegistry.cs +++ b/Shared/MFDLabs.GridHooks/ConsoleHookRegistry.cs @@ -61,19 +61,19 @@ private static void RegisterInternal() private static void ParseAndInsertIntoConsoleHookRegistry() { - SystemLogger.Singleton.LifecycleEvent("Begin attempt to register console hooks via Reflection."); + Logger.Singleton.LifecycleEvent("Begin attempt to register console hooks via Reflection."); try { var @namespace = GetHookNamespace(); - SystemLogger.Singleton.Info("Got console hook namespace '{0}'.", @namespace); + Logger.Singleton.Info("Got console hook namespace '{0}'.", @namespace); var types = Assembly.GetExecutingAssembly().GetTypesInAssemblyNamespace(@namespace); if (types.Length == 0) { - SystemLogger.Singleton.Warning("There were no console hooks found in the namespace '{0}'.", @namespace); + Logger.Singleton.Warning("There were no console hooks found in the namespace '{0}'.", @namespace); return; } @@ -85,11 +85,11 @@ private static void ParseAndInsertIntoConsoleHookRegistry() if (consoleHook is IConsoleHook trueConsoleHook) { - SystemLogger.Singleton.Info("Parsing console hook '{0}'.", type.FullName); + Logger.Singleton.Info("Parsing console hook '{0}'.", type.FullName); if (trueConsoleHook.HookKeys.Length < 1) { - SystemLogger.Singleton.Trace( + Logger.Singleton.Trace( "Exception when reading '{0}': Expected the sizeof field 'HookKeys' to be greater than 0, got {1}", type.FullName, trueConsoleHook.HookKeys.Length @@ -105,11 +105,11 @@ private static void ParseAndInsertIntoConsoleHookRegistry() } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); } finally { - SystemLogger.Singleton.Verbose("Successfully initialized the ConsoleHookRegistry."); + Logger.Singleton.Verbose("Successfully initialized the ConsoleHookRegistry."); } } diff --git a/Shared/MFDLabs.GridHooks/Hooks/ListThreadsHook.cs b/Shared/MFDLabs.GridHooks/Hooks/ListThreadsHook.cs index 98f1547c..509507dd 100644 --- a/Shared/MFDLabs.GridHooks/Hooks/ListThreadsHook.cs +++ b/Shared/MFDLabs.GridHooks/Hooks/ListThreadsHook.cs @@ -12,9 +12,9 @@ public void Callback(char key) { var threads = Process.GetCurrentProcess().Threads; - SystemLogger.Singleton.Log("Total thread count: {0}", threads.Count); + Logger.Singleton.Log("Total thread count: {0}", threads.Count); - foreach (ProcessThread thread in threads) SystemLogger.Singleton.Log("Thread ID: {0}", thread.Id); + foreach (ProcessThread thread in threads) Logger.Singleton.Log("Thread ID: {0}", thread.Id); } } } diff --git a/Shared/MFDLabs.GridHooks/Hooks/SuicideHook.cs b/Shared/MFDLabs.GridHooks/Hooks/SuicideHook.cs index 42a27f2f..f44ed876 100644 --- a/Shared/MFDLabs.GridHooks/Hooks/SuicideHook.cs +++ b/Shared/MFDLabs.GridHooks/Hooks/SuicideHook.cs @@ -10,7 +10,7 @@ public sealed class SuicideHook : IConsoleHook public void Callback(char key) { - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "FORCE EXIT, ALL CACHED ITEMS WILL HAVE TO BE MANUALLY CLEARED. THIS IS POTENTIALLY DANGEROUS AS THE GLOBAL EVENT LIFETIME IS UNEXPECTEDLY CLOSED."); Environment.Exit(0); } diff --git a/Shared/MFDLabs.GridHooks/Hooks/UtcNowHook.cs b/Shared/MFDLabs.GridHooks/Hooks/UtcNowHook.cs index 41f297c6..db9292a6 100644 --- a/Shared/MFDLabs.GridHooks/Hooks/UtcNowHook.cs +++ b/Shared/MFDLabs.GridHooks/Hooks/UtcNowHook.cs @@ -10,6 +10,6 @@ internal sealed class UtcNowHook : IConsoleHook public char[] HookKeys => new[] { 't', 'T' }; public void Callback(char key) - => SystemLogger.Singleton.Log("The current time is '{0}'", DateTime.UtcNow.ToString(CultureInfo.InvariantCulture)); + => Logger.Singleton.Log("The current time is '{0}'", DateTime.UtcNow.ToString(CultureInfo.InvariantCulture)); } } diff --git a/Shared/MFDLabs.GridTasks/WorkQueues/GridServerScreenshotWorkQueue.cs b/Shared/MFDLabs.GridTasks/WorkQueues/GridServerScreenshotWorkQueue.cs index 3dc459cb..81acd348 100644 --- a/Shared/MFDLabs.GridTasks/WorkQueues/GridServerScreenshotWorkQueue.cs +++ b/Shared/MFDLabs.GridTasks/WorkQueues/GridServerScreenshotWorkQueue.cs @@ -81,9 +81,9 @@ private static void HandleWorkQueueException(Exception ex, SocketMessage message perf.TotalItemsProcessedThatFailedPerSecond.Increment(); #if DEBUG || DEBUG_LOGGING_IN_PROD - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); #else - SystemLogger.Singleton.Warning("An error occurred when trying to execute grid server screenshot work queue task: {0}", ex.Message); + Logger.Singleton.Warning("An error occurred when trying to execute grid server screenshot work queue task: {0}", ex.Message); #endif if (!global::MFDLabs.Grid.Bot.Properties.Settings.Default.CareToLeakSensitiveExceptions) @@ -199,7 +199,7 @@ private static void ProcessItem(SocketTaskRequest item) try { #if !NETFRAMEWORK - SystemLogger.Singleton.Warning("Screenshots are not supported on this framework."); + Logger.Singleton.Warning("Screenshots are not supported on this framework."); message.Reply("Grid Server Screenshots are not enabled at this time, please try again later."); #else if (global::MFDLabs.Grid.Properties.Settings.Default.SingleInstancedGridServer) @@ -260,7 +260,7 @@ private static void ProcessItem(SocketTaskRequest item) finally { sw.Stop(); - SystemLogger.Singleton.Debug("Took {0}s to execute grid server screenshot work queue task.", sw.Elapsed.TotalSeconds.ToString("f7")); + Logger.Singleton.Debug("Took {0}s to execute grid server screenshot work queue task.", sw.Elapsed.TotalSeconds.ToString("f7")); if (failure) { diff --git a/Shared/MFDLabs.GridTasks/WorkQueues/RenderingWorkQueue.cs b/Shared/MFDLabs.GridTasks/WorkQueues/RenderingWorkQueue.cs index 9b7368d1..4b5931f8 100644 --- a/Shared/MFDLabs.GridTasks/WorkQueues/RenderingWorkQueue.cs +++ b/Shared/MFDLabs.GridTasks/WorkQueues/RenderingWorkQueue.cs @@ -97,9 +97,9 @@ private static void HandleWorkQueueException(Exception ex, SocketMessage message perf.TotalItemsProcessedThatFailedPerSecond.Increment(); #if DEBUG || DEBUG_LOGGING_IN_PROD - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); #else - SystemLogger.Singleton.Warning("An error occurred when trying to execute render work queue task: {0}", ex.Message); + Logger.Singleton.Warning("An error occurred when trying to execute render work queue task: {0}", ex.Message); #endif if (!global::MFDLabs.Grid.Bot.Properties.Settings.Default.CareToLeakSensitiveExceptions) @@ -189,7 +189,7 @@ private static void ProcessItem(SocketTaskRequest item) if (originalCommandName == "sexually-weird-render") { - SystemLogger.Singleton.Warning("Got the test render command."); + Logger.Singleton.Warning("Got the test render command."); var (weirdStream, weirdFileName) = GridServerCommandUtility.RenderUser( 4, @@ -232,7 +232,7 @@ private static void ProcessItem(SocketTaskRequest item) _perfmon.TotalItemsProcessedThatHadUsernamesThatDidNotCorrespondToAnAccountPerSecond.Increment(); failure = true; - SystemLogger.Singleton.Warning("The ID for the discord user '{0}' was null, they were either banned or do not exist.", message.Author.ToString()); + Logger.Singleton.Warning("The ID for the discord user '{0}' was null, they were either banned or do not exist.", message.Author.ToString()); message.Reply("You have no Roblox account associated with you."); return; } @@ -259,7 +259,7 @@ private static void ProcessItem(SocketTaskRequest item) _perfmon.TotalItemsProcessedThatHadUsernamesThatDidNotCorrespondToAnAccountPerSecond.Increment(); failure = true; - SystemLogger.Singleton.Warning("The ID for the discord user '{0}' was null, they were either banned or do not exist.", user.ToString()); + Logger.Singleton.Warning("The ID for the discord user '{0}' was null, they were either banned or do not exist.", user.ToString()); message.Reply($"The user you mentioned, '{user.Username}', had no Roblox account associated with them."); return; } @@ -268,7 +268,7 @@ private static void ProcessItem(SocketTaskRequest item) } else { - SystemLogger.Singleton.Warning("The first parameter of the command was " + + Logger.Singleton.Warning("The first parameter of the command was " + "not a valid Int64, trying to get the userID " + "by username lookup."); username = contentArray.Join(' ').EscapeNewLines().Escape(); @@ -285,7 +285,7 @@ private static void ProcessItem(SocketTaskRequest item) if (!username.IsNullOrEmpty()) { - SystemLogger.Singleton.Debug("Trying to get the ID of the user by this username '{0}'", username); + Logger.Singleton.Debug("Trying to get the ID of the user by this username '{0}'", username); var nullableUserId = UserUtility.GetUserIdByUsername(username); if (!nullableUserId.HasValue) @@ -294,12 +294,12 @@ private static void ProcessItem(SocketTaskRequest item) _perfmon.TotalItemsProcessedThatHadUsernamesThatDidNotCorrespondToAnAccountPerSecond.Increment(); failure = true; - SystemLogger.Singleton.Warning("The ID for the user '{0}' was null, they were either banned or do not exist.", username); + Logger.Singleton.Warning("The ID for the user '{0}' was null, they were either banned or do not exist.", username); message.Reply($"The user by the username of '{username}' was not found."); return; } - SystemLogger.Singleton.Info("The ID for the user '{0}' was {1}.", username, nullableUserId.Value); + Logger.Singleton.Info("The ID for the user '{0}' was {1}.", username, nullableUserId.Value); userId = nullableUserId.Value; } else @@ -308,7 +308,7 @@ private static void ProcessItem(SocketTaskRequest item) _perfmon.TotalItemsProcessedThatHadNullOrEmptyUsernamesPerSecond.Increment(); failure = true; - SystemLogger.Singleton.Warning("The user's input username was null or empty, they clearly do not know how to input text."); + Logger.Singleton.Warning("The user's input username was null or empty, they clearly do not know how to input text."); message.Reply($"Missing required parameter 'userID' or 'userName', " + $"the layout is: " + $"{MFDLabs.Grid.Bot.Properties.Settings.Default.Prefix}{originalCommandName} " + @@ -325,7 +325,7 @@ private static void ProcessItem(SocketTaskRequest item) _perfmon.TotalItemsProcessedThatHadInvalidUserIDsPerSecond.Increment(); failure = true; - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "The input user ID of {0} was greater than the environment's maximum user ID size of {1}.", userId, global::MFDLabs.Grid.Bot.Properties.Settings.Default.MaxUserIDSize @@ -339,13 +339,13 @@ private static void ProcessItem(SocketTaskRequest item) if (UserUtility.GetIsUserBanned(userId)) { - SystemLogger.Singleton.Warning("The input user ID of {0} was linked to a banned user account.", userId); + Logger.Singleton.Warning("The input user ID of {0} was linked to a banned user account.", userId); var user = userId == default ? username : userId.ToString(); message.Reply($"The user '{user}' is banned or does not exist."); return; } - SystemLogger.Singleton.Info( + Logger.Singleton.Info( "Trying to render the character for the user '{0}' with the place '{1}', " + "and the dimensions of {2}x{3}", userId, @@ -383,7 +383,7 @@ private static void ProcessItem(SocketTaskRequest item) _itemCount--; _processingItem = false; sw.Stop(); - SystemLogger.Singleton.Debug("Took {0}s to execute render work queue task.", sw.Elapsed.TotalSeconds.ToString("f7")); + Logger.Singleton.Debug("Took {0}s to execute render work queue task.", sw.Elapsed.TotalSeconds.ToString("f7")); if (failure) { diff --git a/Shared/MFDLabs.GridTasks/WorkQueues/ScriptExecutionWorkQueue.cs b/Shared/MFDLabs.GridTasks/WorkQueues/ScriptExecutionWorkQueue.cs index d7324243..687b88db 100644 --- a/Shared/MFDLabs.GridTasks/WorkQueues/ScriptExecutionWorkQueue.cs +++ b/Shared/MFDLabs.GridTasks/WorkQueues/ScriptExecutionWorkQueue.cs @@ -114,7 +114,7 @@ private static void HandleWorkQueueException(Exception ex, SocketMessage message return; case FaultException fault: { - SystemLogger.Singleton.Warning("An error occured on the grid server: {0}", fault.Message); + Logger.Singleton.Warning("An error occured on the grid server: {0}", fault.Message); switch (fault.Message) { @@ -151,9 +151,9 @@ private static void HandleWorkQueueException(Exception ex, SocketMessage message } #if DEBUG || DEBUG_LOGGING_IN_PROD - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); #else - SystemLogger.Singleton.Warning("An error occurred when trying to execute render work queue task: {0}", ex.Message); + Logger.Singleton.Warning("An error occurred when trying to execute render work queue task: {0}", ex.Message); #endif if (!global::MFDLabs.Grid.Bot.Properties.Settings.Default.CareToLeakSensitiveExceptions) @@ -304,7 +304,7 @@ private static void ProcessItem(SocketTaskRequest item) ("isAdmin", isAdminScript) ); - if (isAdminScript) SystemLogger.Singleton.Debug("Admin scripts are enabled, disabling VM."); + if (isAdminScript) Logger.Singleton.Debug("Admin scripts are enabled, disabling VM."); if (global::MFDLabs.Grid.Bot.Properties.Settings.Default.ScriptExecutionRequireProtections) script = $"{LuaUtility.SafeLuaMode}{script}"; @@ -408,7 +408,7 @@ private static void ProcessItem(SocketTaskRequest item) { try { - SystemLogger.Singleton.LifecycleEvent( + Logger.Singleton.LifecycleEvent( "Trying delete the script '{0}' at path '{1}'", scriptId, scriptName @@ -416,8 +416,8 @@ private static void ProcessItem(SocketTaskRequest item) FilesHelper.PollDeletionOfFile( scriptName, 10, - ex => SystemLogger.Singleton.Warning("Failed to delete '{0}' because: {1}", scriptName, ex.Message), - () => SystemLogger.Singleton.LifecycleEvent( + ex => Logger.Singleton.Warning("Failed to delete '{0}' because: {1}", scriptName, ex.Message), + () => Logger.Singleton.LifecycleEvent( "Successfully deleted the script '{0}' at path '{1}'!", scriptId, scriptName @@ -428,7 +428,7 @@ private static void ProcessItem(SocketTaskRequest item) { global::MFDLabs.Grid.Bot.Utility.CrashHandler.Upload(ex, true); isFailure = true; - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "Failed to delete the user script '{0}' because '{1}'", scriptName, ex.Message @@ -440,7 +440,7 @@ private static void ProcessItem(SocketTaskRequest item) finally { sw.Stop(); - SystemLogger.Singleton.Debug("Took {0}s to execute script execution work queue task.", sw.Elapsed.TotalSeconds.ToString("f7")); + Logger.Singleton.Debug("Took {0}s to execute script execution work queue task.", sw.Elapsed.TotalSeconds.ToString("f7")); if (isFailure) { diff --git a/Shared/MFDLabs.GridUtility/AdminUtility.cs b/Shared/MFDLabs.GridUtility/AdminUtility.cs index a3912366..fe190554 100644 --- a/Shared/MFDLabs.GridUtility/AdminUtility.cs +++ b/Shared/MFDLabs.GridUtility/AdminUtility.cs @@ -143,7 +143,7 @@ public static async Task RejectIfNotPrivilagedAsync(SocketCommandBase comm return false; } - SystemLogger.Singleton.Info("User '{0}' is privilaged or an admin.", command.User.Id); + Logger.Singleton.Info("User '{0}' is privilaged or an admin.", command.User.Id); return true; } @@ -157,7 +157,7 @@ public static async Task RejectIfNotAdminAsync(SocketCommandBase command) return false; } - SystemLogger.Singleton.Info("User '{0}' is an admin.", command.User.Id); + Logger.Singleton.Info("User '{0}' is an admin.", command.User.Id); return true; } public static async Task RejectIfNotOwnerAsync(SocketCommandBase command) @@ -170,7 +170,7 @@ public static async Task RejectIfNotOwnerAsync(SocketCommandBase command) return false; } - SystemLogger.Singleton.Info("User '{0}' is the owner.", command.User.Id); + Logger.Singleton.Info("User '{0}' is the owner.", command.User.Id); return true; } #endif @@ -185,7 +185,7 @@ public static async Task RejectIfNotPrivilagedAsync(SocketMessage message) return false; } - SystemLogger.Singleton.Info("User '{0}' is privilaged or an admin.", message.Author.Id); + Logger.Singleton.Info("User '{0}' is privilaged or an admin.", message.Author.Id); return true; } @@ -193,12 +193,12 @@ public static async Task RejectIfNotAdminAsync(SocketMessage message) { if (!UserIsAdmin(message.Author)) { - SystemLogger.Singleton.Warning("User '{0}' is not on the admin whitelist. Please take this with " + + Logger.Singleton.Warning("User '{0}' is not on the admin whitelist. Please take this with " + "caution as leaked internal methods may be abused!", message.Author.Id); await message.ReplyAsync("You lack the correct permissions to execute that command."); return false; } - SystemLogger.Singleton.Info("User '{0}' is on the admin whitelist.", message.Author.Id); + Logger.Singleton.Info("User '{0}' is on the admin whitelist.", message.Author.Id); return true; } @@ -206,12 +206,12 @@ public static async Task RejectIfNotOwnerAsync(SocketMessage message) { if (!UserIsOwner(message.Author)) { - SystemLogger.Singleton.Warning("User '{0}' is not the owner. Please take this with caution " + + Logger.Singleton.Warning("User '{0}' is not the owner. Please take this with caution " + "as leaked internal methods may be abused!", message.Author.Id); await message.ReplyAsync("You lack the correct permissions to execute that command."); return false; } - SystemLogger.Singleton.Info("User '{0}' is the owner.", message.Author.Id); + Logger.Singleton.Info("User '{0}' is the owner.", message.Author.Id); return true; } } diff --git a/Shared/MFDLabs.GridUtility/CrashHandler.cs b/Shared/MFDLabs.GridUtility/CrashHandler.cs index 02fe726d..6f2d9418 100644 --- a/Shared/MFDLabs.GridUtility/CrashHandler.cs +++ b/Shared/MFDLabs.GridUtility/CrashHandler.cs @@ -28,7 +28,7 @@ public static void Upload(System.Exception ex, bool overrideSystemWhenExitingCra } catch (global::System.Exception e) { - System.Console.WriteLine(global::MFDLabs.Grid.Bot.Properties.Resources.CrashHandler_Upload_Failure, e.Message); + System.Console.WriteLine(global::MFDLabs.Grid.Bot.Properties.Resources.CrashHandler_Upload_Failure, e.ToString()); } }); } diff --git a/Shared/MFDLabs.GridUtility/ExceptionBasedAutomoderator.cs b/Shared/MFDLabs.GridUtility/ExceptionBasedAutomoderator.cs index c407c217..334b248c 100644 --- a/Shared/MFDLabs.GridUtility/ExceptionBasedAutomoderator.cs +++ b/Shared/MFDLabs.GridUtility/ExceptionBasedAutomoderator.cs @@ -65,28 +65,28 @@ public static bool DetermineIfUserHasExceededExceptionLimit(this IUser user) if (exceptionCounterExpires < DateTime.Now) { - SystemLogger.Singleton.Warning("User {0}'s exception monitor has expired at count {1}", user.Id, exceptionCounter); + Logger.Singleton.Warning("User {0}'s exception monitor has expired at count {1}", user.Id, exceptionCounter); if (exceptionCounter == 0) { - SystemLogger.Singleton.Info("They had an exception counter of 0, so they were just created, return false"); + Logger.Singleton.Info("They had an exception counter of 0, so they were just created, return false"); return false; } // Exlusive in case another thread had hit them just in the nick of time :/ if (exceptionCounter > global::MFDLabs.Grid.Bot.Properties.Settings.Default.ExceptionBasedAutomoderatorMaxExceptionHitsBeforeBlacklist) { - SystemLogger.Singleton.Warning("Their exception counter exceeded the maximum before blacklist, return true"); + Logger.Singleton.Warning("Their exception counter exceeded the maximum before blacklist, return true"); return true; } - SystemLogger.Singleton.Info("The user didn't exceed the maximum before blacklist, reset their track."); + Logger.Singleton.Info("The user didn't exceed the maximum before blacklist, reset their track."); user.UpdateOrCreateTrack(0, global::MFDLabs.Grid.Bot.Properties.Settings.Default.ExceptionBasedAutomoderatorLeaseTimeSpanAddition); return false; } - SystemLogger.Singleton.Info("User's track hasn't expired, check if their exception counter exceeded the maximum before blacklist."); + Logger.Singleton.Info("User's track hasn't expired, check if their exception counter exceeded the maximum before blacklist."); return exceptionCounter > global::MFDLabs.Grid.Bot.Properties.Settings.Default.ExceptionBasedAutomoderatorMaxExceptionHitsBeforeBlacklist; @@ -98,7 +98,7 @@ public static bool CheckIfUserShouldBeBlacklisted(this IUser user) if (user.DetermineIfUserHasExceededExceptionLimit()) { - SystemLogger.Singleton.Warning("The user exceeded their exception limit, blacklist them now."); + Logger.Singleton.Warning("The user exceeded their exception limit, blacklist them now."); user.Blacklist(); return true; } @@ -112,7 +112,7 @@ public static void IncrementExceptionLimit(this IUser user) if (user.CheckIfUserShouldBeBlacklisted()) return; - SystemLogger.Singleton.Verbose("User {0} has not exceeded the exception limit, increment their count atomically.", user.Id); + Logger.Singleton.Verbose("User {0} has not exceeded the exception limit, increment their count atomically.", user.Id); user.UpdateOrCreateTrack(null, null, true); } diff --git a/Shared/MFDLabs.GridUtility/GridServerCommandUtility.cs b/Shared/MFDLabs.GridUtility/GridServerCommandUtility.cs index 670e2603..057109dc 100644 --- a/Shared/MFDLabs.GridUtility/GridServerCommandUtility.cs +++ b/Shared/MFDLabs.GridUtility/GridServerCommandUtility.cs @@ -122,7 +122,7 @@ public static (Stream, string) RenderUser(long userId, long placeId, int sizeX, { var url = GetAvatarFetchUrl(userId, placeId); - SystemLogger.Singleton.Warning( + Logger.Singleton.Warning( "Trying to render user '{0}' in place '{1}' with the dimensions of {2}x{3} with the url '{4}'", userId, placeId, @@ -160,24 +160,24 @@ public static (Stream, string) RenderUser(long userId, long placeId, int sizeX, ) ); - SystemLogger.Singleton.Warning("Trying to convert the reponse from a Base64 string via: Convert.FromBase64String()"); + Logger.Singleton.Warning("Trying to convert the reponse from a Base64 string via: Convert.FromBase64String()"); var first = result.ElementAt(0); if (first != null) { //setting when for how much is truncated ;-; - SystemLogger.Singleton.Warning("Returning image contents of '{0}...[Truncated]'.", first.value.Substring(0, 150)); + Logger.Singleton.Warning("Returning image contents of '{0}...[Truncated]'.", first.value.Substring(0, 150)); return (new MemoryStream(Convert.FromBase64String(first.value)), GetFileName(userId, placeId, settings)); } - SystemLogger.Singleton.Error("The first return argument for the render was null, this may be an issue with the grid server."); + Logger.Singleton.Error("The first return argument for the render was null, this may be an issue with the grid server."); return (null, null); } catch (Exception ex) { - SystemLogger.Singleton.Error(ex); + Logger.Singleton.Error(ex); return (null, null); } } diff --git a/Shared/MFDLabs.GridUtility/LuaUtility.cs b/Shared/MFDLabs.GridUtility/LuaUtility.cs index d08bf406..dfb41bdd 100644 --- a/Shared/MFDLabs.GridUtility/LuaUtility.cs +++ b/Shared/MFDLabs.GridUtility/LuaUtility.cs @@ -30,7 +30,7 @@ public static bool CheckIfScriptContainsDisallowedText(string script, out string if (!global::MFDLabs.Grid.Bot.Properties.Settings.Default.ScriptExectionCareAboutBadTextCase) parsedScript = script.ToLower(); - SystemLogger.Singleton.Info("Check if script '{0}' contains blacklisted words.", escapedString); + Logger.Singleton.Info("Check if script '{0}' contains blacklisted words.", escapedString); foreach (var keyword in GetBlacklistedKeywords()) { @@ -41,12 +41,12 @@ public static bool CheckIfScriptContainsDisallowedText(string script, out string if (!parsedScript.Contains(parsedKeyword)) continue; word = parsedKeyword; - SystemLogger.Singleton.Warning("The script '{0}' contains blacklisted words.", escapedString); + Logger.Singleton.Warning("The script '{0}' contains blacklisted words.", escapedString); return true; } - SystemLogger.Singleton.Info("The script '{0}' does not contain blacklisted words.", escapedString); + Logger.Singleton.Info("The script '{0}' does not contain blacklisted words.", escapedString); return false; } diff --git a/Shared/MFDLabs.GridUtility/ShutdownUdpReceiver.cs b/Shared/MFDLabs.GridUtility/ShutdownUdpReceiver.cs index cc519aec..612d3bdb 100644 --- a/Shared/MFDLabs.GridUtility/ShutdownUdpReceiver.cs +++ b/Shared/MFDLabs.GridUtility/ShutdownUdpReceiver.cs @@ -16,7 +16,7 @@ public static void Receive(object dummy) { var sock = new UdpClient(new IPEndPoint(IPAddress.Loopback, 47001)); - SystemLogger.Singleton.LifecycleEvent("Receiving shutdown requests on 127.0.0.1:47001"); + Logger.Singleton.LifecycleEvent("Receiving shutdown requests on 127.0.0.1:47001"); var sender = new IPEndPoint(IPAddress.Loopback, 0); @@ -24,7 +24,7 @@ public static void Receive(object dummy) { var ver = sock.Receive(ref sender); - SystemLogger.Singleton.Warning("Received a shutdown request."); + Logger.Singleton.Warning("Received a shutdown request."); GridProcessHelper.KillAllGridServersSafe(); GridServerArbiter.Singleton.KillAllOpenInstancesUnsafe(); diff --git a/Shared/MFDLabs.GridUtility/SignalUtility.cs b/Shared/MFDLabs.GridUtility/SignalUtility.cs index b92b949e..93e761bc 100644 --- a/Shared/MFDLabs.GridUtility/SignalUtility.cs +++ b/Shared/MFDLabs.GridUtility/SignalUtility.cs @@ -29,7 +29,7 @@ public static void InvokeInteruptSignal(bool killBot = true) GridProcessHelper.KillAllGridServersSafe(); GridProcessHelper.KillServerSafe(); LoggingSystem.EndLifetimeWatch(); - SystemLogger.Singleton.TryClearLocalLog(false, true); + Logger.TryClearLocalLog(false); Environment.Exit(0); }, TimeSpan.FromSeconds(1)); } @@ -50,7 +50,7 @@ public static void InvokeUserSignal1(bool killBot = true) if (killBot) await BotGlobal.TryLogout(); LoggingSystem.EndLifetimeWatch(); - SystemLogger.Singleton.TryClearLocalLog(false, true); + Logger.TryClearLocalLog(true); Environment.Exit(0); }, TimeSpan.FromSeconds(1)); } @@ -66,7 +66,7 @@ await GoogleAnalyticsManager.TrackNetworkEventAsync("Restart", "SIGUSR2", if (killBot) await BotGlobal.TryLogout(); - SystemLogger.Singleton.TryClearLocalLog(true); + Logger.TryClearLocalLog(true); LoggingSystem.RestartLifetimeWatch(); await BotGlobal.SingletonLaunch();