mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-04-28 19:15:45 +02:00
Refactor PhantomLogger overloads
This commit is contained in:
parent
3c10e1a8f9
commit
c4cf45776d
Agent
Phantom.Agent.Minecraft/Java
Phantom.Agent.Rpc
Phantom.Agent
Common/Phantom.Common.Logging
Server/Phantom.Server
@ -7,7 +7,7 @@ using Serilog;
|
||||
namespace Phantom.Agent.Minecraft.Java;
|
||||
|
||||
public sealed class JavaRuntimeDiscovery {
|
||||
private static readonly ILogger Logger = PhantomLogger.Create(typeof(JavaRuntimeDiscovery));
|
||||
private static readonly ILogger Logger = PhantomLogger.Create(nameof(JavaRuntimeDiscovery));
|
||||
|
||||
public static string? GetSystemSearchPath() {
|
||||
const string LinuxJavaPath = "/usr/lib/jvm";
|
||||
|
@ -5,7 +5,7 @@ using Serilog;
|
||||
namespace Phantom.Agent.Rpc;
|
||||
|
||||
public static class ServerMessaging {
|
||||
private static readonly ILogger Logger = PhantomLogger.Create(typeof(ServerMessaging));
|
||||
private static readonly ILogger Logger = PhantomLogger.Create(nameof(ServerMessaging));
|
||||
|
||||
private static RpcServerConnection? CurrentConnection { get; set; }
|
||||
private static RpcServerConnection CurrentConnectionOrThrow => CurrentConnection ?? throw new InvalidOperationException("Server connection not ready.");
|
||||
|
@ -8,7 +8,7 @@ using Serilog;
|
||||
namespace Phantom.Agent;
|
||||
|
||||
static class AgentKey {
|
||||
private static ILogger Logger { get; } = PhantomLogger.Create(typeof(AgentKey));
|
||||
private static ILogger Logger { get; } = PhantomLogger.Create(nameof(AgentKey));
|
||||
|
||||
public static Task<(NetMQCertificate, AgentAuthToken)?> Load(string? agentKeyToken, string? agentKeyFilePath) {
|
||||
if (agentKeyFilePath != null) {
|
||||
|
@ -6,7 +6,7 @@ using Serilog;
|
||||
namespace Phantom.Agent;
|
||||
|
||||
static class GuidFile {
|
||||
private static ILogger Logger { get; } = PhantomLogger.Create(typeof(GuidFile));
|
||||
private static ILogger Logger { get; } = PhantomLogger.Create(nameof(GuidFile));
|
||||
|
||||
private const string GuidFileName = "agent.guid";
|
||||
|
||||
|
@ -33,8 +33,8 @@ public static class PhantomLogger {
|
||||
return Base.ForContext("Category", name);
|
||||
}
|
||||
|
||||
public static ILogger Create(Type type) {
|
||||
return Create(type.Name);
|
||||
public static ILogger Create(string name1, string name2) {
|
||||
return Create(name1 + ":" + name2);
|
||||
}
|
||||
|
||||
public static ILogger Create<T>() {
|
||||
@ -42,11 +42,11 @@ public static class PhantomLogger {
|
||||
}
|
||||
|
||||
public static ILogger Create<T>(string name) {
|
||||
return Create(typeof(T).Name + ":" + name);
|
||||
return Create(typeof(T).Name, name);
|
||||
}
|
||||
|
||||
public static ILogger Create<T1, T2>() {
|
||||
return Create(typeof(T1).Name + ":" + typeof(T2).Name);
|
||||
return Create(typeof(T1).Name, typeof(T2).Name);
|
||||
}
|
||||
|
||||
public static void Dispose() {
|
||||
|
@ -8,7 +8,7 @@ using Serilog;
|
||||
namespace Phantom.Server;
|
||||
|
||||
static class CertificateFiles {
|
||||
private static ILogger Logger { get; } = PhantomLogger.Create(typeof(CertificateFiles));
|
||||
private static ILogger Logger { get; } = PhantomLogger.Create(nameof(CertificateFiles));
|
||||
|
||||
private const string SecretKeyFileName = "secret.key";
|
||||
private const string AgentKeyFileName = "agent.key";
|
||||
|
Loading…
Reference in New Issue
Block a user