mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-24 11:48:39 +08:00
[logging] Migrate CpuDispatcher, SharpEmuRuntime, PhysicalVirtualMemory to SharpEmuLog (#51)
Replaces 34 Console.Error.WriteLine call sites across 3 Core files with structured SharpEmuLog calls (Debug/Info/Warning/Error/Critical). CpuDispatcher.cs (10 sites): - DispatchEntry/DispatchModuleInitializer START and entry-point logs -> Debug - FATAL EXCEPTION catch blocks -> Critical (with exception object) - Native backend FAILED -> Error SharpEmuRuntime.cs (23 sites): - Loading/Entry/Dispatching/DispatchEntry returned -> Info - Module load/registered/preload summary -> Info - Initializer dispatch failed/module start failed -> Error - Imported data unresolved -> Warning, write-failed -> Error - Import stub conflict -> Warning - Trace-level rebind logs -> Debug PhysicalVirtualMemory.cs (1 site): - TraceVmem helper -> Log.Debug (SHARPEMU_LOG_VMEM env gate preserved) Build: 0 errors, 0 warnings Co-authored-by: Hermes Atlas <hermesatlas@example.com>
This commit is contained in:
@@ -4,11 +4,14 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using SharpEmu.Core.Loader;
|
||||
using SharpEmu.HLE;
|
||||
using SharpEmu.Logging;
|
||||
|
||||
namespace SharpEmu.Core.Memory;
|
||||
|
||||
public sealed unsafe class PhysicalVirtualMemory : IVirtualMemory, IGuestMemoryAllocator, IDisposable
|
||||
{
|
||||
private static readonly SharpEmuLogger Log = SharpEmuLog.For("VMEM");
|
||||
|
||||
private readonly ReaderWriterLockSlim _gate = new(LockRecursionPolicy.SupportsRecursion);
|
||||
private readonly object _guestAllocationGate = new();
|
||||
private readonly object _allocationSearchHintGate = new();
|
||||
@@ -1052,7 +1055,7 @@ public sealed unsafe class PhysicalVirtualMemory : IVirtualMemory, IGuestMemoryA
|
||||
return;
|
||||
}
|
||||
|
||||
Console.Error.WriteLine($"[VMEM] {message}");
|
||||
Log.Debug(message);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
Reference in New Issue
Block a user