Logging Improvements
Add Trace functions to SVC. Add function to get the function name who called.
This commit is contained in:
parent
a913c620bd
commit
45e5f901d1
2 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Ryujinx
|
namespace Ryujinx
|
||||||
|
@ -59,7 +60,7 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
if (EnableTrace)
|
if (EnableTrace)
|
||||||
{
|
{
|
||||||
string Text = $"{GetExecutionTime()} | TRACE > {Message}";
|
string Text = $"{GetExecutionTime()} | TRACE > {WhoCalledMe()} - {Message}";
|
||||||
|
|
||||||
Console.ForegroundColor = ConsoleColor.DarkGray;
|
Console.ForegroundColor = ConsoleColor.DarkGray;
|
||||||
Console.WriteLine(Text.PadLeft(Text.Length + 1, ' '));
|
Console.WriteLine(Text.PadLeft(Text.Length + 1, ' '));
|
||||||
|
@ -124,5 +125,10 @@ namespace Ryujinx
|
||||||
LogFile(Text);
|
LogFile(Text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string WhoCalledMe()
|
||||||
|
{
|
||||||
|
return new StackTrace().GetFrame(2).GetMethod().Name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,9 @@ namespace Ryujinx.OsHle.Svc
|
||||||
|
|
||||||
if (SvcFuncs.TryGetValue(e.Id, out SvcFunc Func))
|
if (SvcFuncs.TryGetValue(e.Id, out SvcFunc Func))
|
||||||
{
|
{
|
||||||
|
Logging.Trace($"{Func.Method.Name} called.");
|
||||||
Func(Ns, Registers, Memory);
|
Func(Ns, Registers, Memory);
|
||||||
|
Logging.Trace($"{Func.Method.Name} ended.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue