Reorganize project structure

This commit is contained in:
Stone_Red
2026-06-19 00:56:46 +02:00
parent 6f58eefb66
commit 95d88f1a8d
84 changed files with 267 additions and 186 deletions
@@ -0,0 +1,40 @@
using RemSox.Kernel.Logging;
using RemSox.Kernel.Processing;
namespace RemSox.Kernel.UI.CLI.Commands;
public class ViewProcessLogs : ICommand
{
public string Name => "logs";
public string Description => "View logs for a process";
public Task ExecuteAsync(string? arguments, Action<string> printLine)
{
if (int.TryParse(arguments, out int processId))
{
IEnumerable<LogEntry> logs = ProcessManager.GetProcessLogs(processId);
PrintLogs(logs, printLine);
}
else
{
IEnumerable<LogEntry> logs = ProcessManager.GetLogs();
PrintLogs(logs, printLine);
}
return Task.CompletedTask;
}
private static void PrintLogs(IEnumerable<LogEntry> logs, Action<string> printLine)
{
if (!logs.Any())
{
printLine("No logs found!");
return;
}
foreach (LogEntry log in logs)
{
printLine($"[{log.Timestamp:HH:mm:ss}] [{log.Severity}] {log.Message}");
}
}
}