move old systemout to use errorhandler
This commit is contained in:
@@ -659,9 +659,27 @@ function MemoryScanner.saveReport(report, filename)
|
||||
if file then
|
||||
file:write(formatted)
|
||||
file:close()
|
||||
print(string.format("[MemoryScanner] Report saved to %s", filename))
|
||||
-- Use ErrorHandler if available, otherwise fall back to print
|
||||
if MemoryScanner._ErrorHandler then
|
||||
MemoryScanner._ErrorHandler:warn("MemoryScanner", "RES_004", {
|
||||
resourceType = "report",
|
||||
path = filename,
|
||||
status = "saved",
|
||||
})
|
||||
else
|
||||
print(string.format("[MemoryScanner] Report saved to %s", filename))
|
||||
end
|
||||
else
|
||||
print(string.format("[MemoryScanner] Failed to save report to %s", filename))
|
||||
-- Use ErrorHandler if available, otherwise fall back to print
|
||||
if MemoryScanner._ErrorHandler then
|
||||
MemoryScanner._ErrorHandler:warn("MemoryScanner", "RES_004", {
|
||||
resourceType = "report",
|
||||
path = filename,
|
||||
status = "failed to save",
|
||||
})
|
||||
else
|
||||
print(string.format("[MemoryScanner] Failed to save report to %s", filename))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user