1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2025-05-04 18:34:05 +02:00

Move most verbose log messages to debug level

This commit is contained in:
chylex 2023-02-28 00:07:54 +01:00
parent 8f003c6351
commit ffa0ff24fa
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
16 changed files with 28 additions and 28 deletions

View File

@ -26,7 +26,7 @@ sealed class MinecraftServerExecutableDownloader {
public void Register(MinecraftServerExecutableDownloadListener listener) {
++listeners;
Logger.Verbose("Registered download listener, current listener count: {Listeners}", listeners);
Logger.Debug("Registered download listener, current listener count: {Listeners}", listeners);
DownloadProgress += listener.DownloadProgressEventHandler;
listener.CancellationToken.Register(Unregister, listener);
@ -37,11 +37,11 @@ sealed class MinecraftServerExecutableDownloader {
DownloadProgress -= listener.DownloadProgressEventHandler;
if (--listeners <= 0) {
Logger.Verbose("Unregistered last download listener, cancelling download.");
Logger.Debug("Unregistered last download listener, cancelling download.");
cancellationTokenSource.Cancel();
}
else {
Logger.Verbose("Unregistered download listener, current listener count: {Listeners}", listeners);
Logger.Debug("Unregistered download listener, current listener count: {Listeners}", listeners);
}
}
@ -50,7 +50,7 @@ sealed class MinecraftServerExecutableDownloader {
}
private void OnCompleted(Task task) {
Logger.Verbose("Download task completed.");
Logger.Debug("Download task completed.");
Completed?.Invoke(this, EventArgs.Empty);
Completed = null;
DownloadProgress = null;

View File

@ -84,7 +84,7 @@ public sealed class ServerStatusProtocol {
return null;
}
logger.Verbose("Detected {OnlinePlayerCount} online player(s).", onlinePlayerCount);
logger.Debug("Detected {OnlinePlayerCount} online player(s).", onlinePlayerCount);
return onlinePlayerCount;
} finally {
ArrayPool<byte>.Shared.Return(messageBuffer);

View File

@ -69,7 +69,7 @@ public sealed class RpcLauncher : RpcRuntime<ClientSocket> {
} catch (OperationCanceledException) {
// Ignore.
} finally {
logger.Verbose("ZeroMQ client stopped receiving messages.");
logger.Debug("ZeroMQ client stopped receiving messages.");
disconnectSemaphore.Wait(CancellationToken.None);
keepAliveLoop.Cancel();

View File

@ -69,7 +69,7 @@ sealed class BackupArchiver {
return null;
}
logger.Verbose("Created world backup: {FilePath}", backupFilePath);
logger.Debug("Created world backup: {FilePath}", backupFilePath);
return backupFilePath;
}
@ -135,7 +135,7 @@ sealed class BackupArchiver {
foreach (FileInfo file in sourceFolder.EnumerateFiles()) {
var filePath = relativePath.Add(file.Name);
if (IsFileSkipped(filePath)) {
logger.Verbose("Skipping file: {File}", string.Join('/', filePath));
logger.Debug("Skipping file: {File}", string.Join('/', filePath));
continue;
}
@ -150,7 +150,7 @@ sealed class BackupArchiver {
foreach (DirectoryInfo directory in sourceFolder.EnumerateDirectories()) {
var folderPath = relativePath.Add(directory.Name);
if (IsFolderSkipped(folderPath)) {
logger.Verbose("Skipping folder: {Folder}", string.Join('/', folderPath));
logger.Debug("Skipping folder: {Folder}", string.Join('/', folderPath));
continue;
}

View File

@ -59,7 +59,7 @@ static class BackupCompressor {
static void OnZstdOutput(object? sender, DataReceivedEventArgs e) {
if (!string.IsNullOrWhiteSpace(e.Data)) {
ZstdLogger.Verbose("[Output] {Line}", e.Data);
ZstdLogger.Debug("[Output] {Line}", e.Data);
}
}

View File

@ -79,7 +79,7 @@ sealed class BackupScheduler : CancellableBackgroundTask {
await Task.Delay(TimeSpan.FromSeconds(10), CancellationToken);
Logger.Verbose("Waiting for server output before checking for online players again...");
Logger.Debug("Waiting for server output before checking for online players again...");
await serverOutputWhileWaitingForOnlinePlayers.WaitHandle.WaitOneAsync(CancellationToken);
}
} finally {
@ -90,7 +90,7 @@ sealed class BackupScheduler : CancellableBackgroundTask {
private void ServerOutputListener(object? sender, string line) {
if (!serverOutputWhileWaitingForOnlinePlayers.IsSet) {
serverOutputWhileWaitingForOnlinePlayers.Set();
Logger.Verbose("Detected server output, signalling to check for online players again.");
Logger.Debug("Detected server output, signalling to check for online players again.");
}
}
}

View File

@ -59,19 +59,19 @@ sealed partial class BackupServerCommandDispatcher : IDisposable {
if (!automaticSavingDisabled.Task.IsCompleted) {
if (info == "Automatic saving is now disabled") {
logger.Verbose("Detected that automatic saving is disabled.");
logger.Debug("Detected that automatic saving is disabled.");
automaticSavingDisabled.SetResult();
}
}
else if (!savedTheGame.Task.IsCompleted) {
if (info == "Saved the game") {
logger.Verbose("Detected that the game is saved.");
logger.Debug("Detected that the game is saved.");
savedTheGame.SetResult();
}
}
else if (!automaticSavingEnabled.Task.IsCompleted) {
if (info == "Automatic saving is now enabled") {
logger.Verbose("Detected that automatic saving is enabled.");
logger.Debug("Detected that automatic saving is enabled.");
automaticSavingEnabled.SetResult();
}
}

View File

@ -78,7 +78,7 @@ sealed class Instance : IDisposable {
disposable.Dispose();
}
logger.Verbose("Transitioning instance state to: {NewState}", newState.GetType().Name);
logger.Debug("Transitioning instance state to: {NewState}", newState.GetType().Name);
var wasRunning = IsRunning;
currentState = newState;
@ -170,12 +170,12 @@ sealed class Instance : IDisposable {
if (!instance.IsRunning) {
// Only InstanceSessionManager is allowed to transition an instance out of a non-running state.
instance.logger.Verbose("Cancelled state transition to {State} because instance is not running.", state.GetType().Name);
instance.logger.Debug("Cancelled state transition to {State} because instance is not running.", state.GetType().Name);
return;
}
if (state is not InstanceNotRunningState && shutdownCancellationToken.IsCancellationRequested) {
instance.logger.Verbose("Cancelled state transition to {State} due to Agent shutdown.", state.GetType().Name);
instance.logger.Debug("Cancelled state transition to {State} due to Agent shutdown.", state.GetType().Name);
return;
}

View File

@ -16,7 +16,7 @@ sealed class InstanceSession : IDisposable {
}
private void SessionOutput(object? sender, string line) {
context.Logger.Verbose("[Server] {Line}", line);
context.Logger.Debug("[Server] {Line}", line);
logSender.Enqueue(line);
}

View File

@ -110,7 +110,7 @@ sealed class InstanceRunningState : IInstanceState {
}
}
} catch (OperationCanceledException) {
context.Logger.Verbose("Cancelled delayed stop.");
context.Logger.Debug("Cancelled delayed stop.");
return;
} catch (ObjectDisposedException) {
return;

View File

@ -120,7 +120,7 @@ public sealed class MinecraftVersions : IDisposable {
var type = MinecraftVersionTypes.FromString(typeString);
if (type == MinecraftVersionType.Other) {
Logger.Verbose("Unknown version type: {Type} ({Version})", typeString, id);
Logger.Warning("Unknown version type: {Type} ({Version})", typeString, id);
}
JsonElement urlElement = GetJsonPropertyOrThrow(versionElement, "url", JsonValueKind.String, "version entry in version manifest");

View File

@ -46,7 +46,7 @@ public sealed class RpcLauncher : RpcRuntime<ServerSocket> {
void OnConnectionClosed(object? sender, RpcClientConnectionClosedEventArgs e) {
clients.Remove(e.RoutingId);
logger.Verbose("Closed connection to {RoutingId}.", e.RoutingId);
logger.Debug("Closed connection to {RoutingId}.", e.RoutingId);
}
while (!cancellationToken.IsCancellationRequested) {

View File

@ -40,7 +40,7 @@ public sealed class PhantomLoginManager {
var result = await signInManager.CheckPasswordSignInAsync(user, password, lockoutOnFailure: true);
if (result == SignInResult.Success) {
Logger.Verbose("Created login token for {Username}.", username);
Logger.Debug("Created login token for {Username}.", username);
string token = TokenGenerator.Create(60);
loginStore.Add(token, user, password, returnUrl ?? string.Empty);

View File

@ -30,7 +30,7 @@ public sealed class PhantomLoginStore {
foreach (var (token, entry) in loginEntries) {
if (entry.IsExpired) {
Logger.Verbose("Expired login entry for {Username}.", entry.User.UserName);
Logger.Debug("Expired login entry for {Username}.", entry.User.UserName);
loginEntries.TryRemove(token, out _);
}
}
@ -50,7 +50,7 @@ public sealed class PhantomLoginStore {
}
if (entry.IsExpired) {
Logger.Verbose("Expired login entry for {Username}.", entry.User.UserName);
Logger.Debug("Expired login entry for {Username}.", entry.User.UserName);
return null;
}

View File

@ -15,7 +15,7 @@ public abstract class CancellableBackgroundTask {
}
private async Task Run() {
Logger.Verbose("Task started.");
Logger.Debug("Task started.");
try {
await RunTask();
@ -25,7 +25,7 @@ public abstract class CancellableBackgroundTask {
Logger.Fatal(e, "Caught exception in task.");
} finally {
cancellationTokenSource.Dispose();
Logger.Verbose("Task stopped.");
Logger.Debug("Task stopped.");
}
}

View File

@ -50,7 +50,7 @@ public sealed class OneShotProcess {
return false;
}
logger.Verbose("Process finished successfully.");
logger.Debug("Process finished successfully.");
return true;
}