Add logclass, made changes to logging calls (#79)

* add logclass, made changes to logging calls

* made enum parsing case insensitive

* enable logclass on partial or complete match
This commit is contained in:
emmauss
2018-04-14 04:02:24 +03:00
committed by gdkchan
parent 435f9ffad8
commit bbcad307bd
20 changed files with 180 additions and 98 deletions

View File

@@ -58,7 +58,7 @@ namespace Ryujinx.Core.OsHle.Services.Am
int Module = ErrorCode & 0xFF;
int Description = (ErrorCode >> 9) & 0xFFF;
Logging.Info($"({(ErrorModule)Module}){2000 + Module}-{Description}");
Logging.Info(LogClass.ServiceAm, $"({(ErrorModule)Module}){2000 + Module}-{Description}");
return 0;
}

View File

@@ -124,14 +124,14 @@ namespace Ryujinx.Core.OsHle.Services.Aud
public long AppendAudioOutBufferEx(ServiceCtx Context)
{
Logging.Warn("Not implemented!");
Logging.Warn(LogClass.ServiceAudio, "Not implemented!");
return 0;
}
public long GetReleasedAudioOutBufferEx(ServiceCtx Context)
{
Logging.Warn("Not implemented!");
Logging.Warn(LogClass.ServiceAudio, "Not implemented!");
return 0;
}

View File

@@ -428,7 +428,7 @@ namespace Ryujinx.Core.OsHle.Services.Bsd
Reader.ReadByte().ToString() + "." +
Reader.ReadByte().ToString();
Logging.Debug($"Try to connect to {IpAddress}:{Port}");
Logging.Debug(LogClass.ServiceBsd, $"Try to connect to {IpAddress}:{Port}");
Sockets[SocketId].IpAddress = IPAddress.Parse(IpAddress);
Sockets[SocketId].RemoteEP = new IPEndPoint(Sockets[SocketId].IpAddress, Port);

View File

@@ -81,7 +81,7 @@ namespace Ryujinx.Core.OsHle.Services
{
Context.ResponseData.BaseStream.Seek(IsDomain ? 0x20 : 0x10, SeekOrigin.Begin);
Logging.Trace($"{Service.GetType().Name}: {ProcessRequest.Method.Name}");
Logging.Trace(LogClass.KernelIpc, $"{Service.GetType().Name}: {ProcessRequest.Method.Name}");
long Result = ProcessRequest(Context);

View File

@@ -129,11 +129,11 @@ namespace Ryujinx.Core.OsHle.Services.Lm
switch((Severity)iSeverity)
{
case Severity.Trace: Logging.Trace(LogString); break;
case Severity.Info: Logging.Info(LogString); break;
case Severity.Warning: Logging.Warn(LogString); break;
case Severity.Error: Logging.Error(LogString); break;
case Severity.Critical: Logging.Fatal(LogString); break;
case Severity.Trace: Logging.Trace(LogClass.ServiceLm, LogString); break;
case Severity.Info: Logging.Info(LogClass.ServiceLm, LogString); break;
case Severity.Warning: Logging.Warn(LogClass.ServiceLm, LogString); break;
case Severity.Error: Logging.Error(LogClass.ServiceLm, LogString); break;
case Severity.Critical: Logging.Fatal(LogClass.ServiceLm, LogString); break;
}
return 0;

View File

@@ -228,7 +228,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn($"Trying to use invalid NvMap Handle {Handle}!");
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}
@@ -634,7 +634,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
Context.Memory.WriteInt32(Position + 4, Map.Handle);
Logging.Info($"NvMap {Map.Id} created with size {Size:x8}!");
Logging.Info(LogClass.ServiceNv, $"NvMap {Map.Id} created with size {Size:x8}!");
return 0;
}
@@ -649,7 +649,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn($"Trying to use invalid NvMap Id {Id}!");
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Id {Id}!");
return -1; //TODO: Corrent error code.
}
@@ -676,7 +676,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn($"Trying to use invalid NvMap Handle {Handle}!");
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}
@@ -702,7 +702,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn($"Trying to use invalid NvMap Handle {Handle}!");
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}
@@ -727,7 +727,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn($"Trying to use invalid NvMap Handle {Handle}!");
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}
@@ -757,7 +757,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
if (Map == null)
{
Logging.Warn($"Trying to use invalid NvMap Handle {Handle}!");
Logging.Warn(LogClass.ServiceNv, $"Trying to use invalid NvMap Handle {Handle}!");
return -1; //TODO: Corrent error code.
}

View File

@@ -112,7 +112,7 @@ namespace Ryujinx.Core.OsHle.Services.Android
if (Commands.TryGetValue((InterfaceName, Code), out ServiceProcessParcel ProcReq))
{
Logging.Debug($"{InterfaceName} {ProcReq.Method.Name}");
Logging.Debug(LogClass.ServiceNv, $"{InterfaceName} {ProcReq.Method.Name}");
return ProcReq(Context, Reader);
}
@@ -412,7 +412,7 @@ namespace Ryujinx.Core.OsHle.Services.Android
break;
}
Logging.Debug("Waiting for a free BufferQueue slot...");
Logging.Debug(LogClass.ServiceNv, "Waiting for a free BufferQueue slot...");
if (Disposed)
{
@@ -426,7 +426,7 @@ namespace Ryujinx.Core.OsHle.Services.Android
}
while (!Disposed);
Logging.Debug($"Found free BufferQueue slot {Slot}!");
Logging.Debug(LogClass.ServiceNv, $"Found free BufferQueue slot {Slot}!");
return Slot;
}