Save device information to log from all commands that speak to a device.

This commit is contained in:
2025-08-19 15:55:06 +01:00
parent 86d794213a
commit 6bb0483c87
4 changed files with 12 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ using Aaru.CommonTypes.Metadata;
using Aaru.CommonTypes.Structs.Devices.ATA;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Core;
using Aaru.Core.Logging;
using Aaru.Database;
using Aaru.Database.Models;
using Aaru.Decoders.SCSI;
@@ -100,6 +101,8 @@ sealed class DeviceReportCommand : AsyncCommand<DeviceReportCommand.Settings>
return (int)ErrorNumber.CannotOpenDevice;
}
DumpLog.StartLog(dev, false);
Statistics.AddDevice(dev);
bool isAdmin = dev is Devices.Remote.Device remoteDev2 ? remoteDev2.IsAdmin : DetectOS.IsAdmin;

View File

@@ -40,6 +40,7 @@ using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs.Devices.ATA;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Core;
using Aaru.Core.Logging;
using Aaru.Database;
using Aaru.Database.Models;
using Aaru.Decoders.DVD;
@@ -109,6 +110,8 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
Statistics.AddDevice(dev);
DumpLog.StartLog(dev, false);
Table table;
if(dev.IsUsb)

View File

@@ -39,6 +39,7 @@ using Aaru.CommonTypes.Structs;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Core;
using Aaru.Core.Devices.Dumping;
using Aaru.Core.Logging;
using Aaru.Core.Media.Info;
using Aaru.Database;
using Aaru.Database.Models;
@@ -115,6 +116,8 @@ sealed class MediaInfoCommand : Command<MediaInfoCommand.Settings>
return (int)ErrorNumber.CannotOpenDevice;
}
DumpLog.StartLog(dev, false);
Statistics.AddDevice(dev);
switch(dev.Type)

View File

@@ -35,6 +35,7 @@ using System.ComponentModel;
using Aaru.CommonTypes.Enums;
using Aaru.Core;
using Aaru.Core.Devices.Scanning;
using Aaru.Core.Logging;
using Aaru.Localization;
using Aaru.Logging;
using Humanizer;
@@ -100,6 +101,8 @@ sealed class MediaScanCommand : Command<MediaScanCommand.Settings>
return (int)ErrorNumber.CannotOpenDevice;
}
DumpLog.StartLog(dev, false);
Statistics.AddDevice(dev);
var scanner = new MediaScan(settings.MhddLog, settings.IbgLog, devicePath, dev, settings.UseBufferedReads);