Fix missing logging for a LUN when the LUN is explicitly specified (#1379)

* Fix missing logging for a LUN when the LUN is explicitly specified

* Do not suppress controller messages when LUN is specified

* Fix misleading logging for DaynaPort
This commit is contained in:
Uwe Seimet 2023-11-26 05:25:54 +01:00 committed by Daniel Markstedt
parent 4e3df76fa8
commit 432a0fd491
2 changed files with 12 additions and 10 deletions

View File

@ -865,6 +865,10 @@ bool ScsiController::XferOutBlockOriented(bool cont)
LogTrace("Done with DaynaPort Set Multicast Address");
break;
case scsi_command::eCmdSetIfaceMode:
LogTrace("Done with setting DaynaPort MAC address (ignore)");
break;
default:
stringstream s;
s << "Received an unexpected command ($" << setfill('0') << setw(2) << hex

View File

@ -39,16 +39,14 @@ void DeviceLogger::Error(const string& message) const
void DeviceLogger::Log(level::level_enum level, const string& message) const
{
if (!message.empty() &&
(log_device_id == -1 ||
(log_device_id == id && (log_device_lun == -1 || log_device_lun == lun)))) {
if (lun == -1) {
log(level, "(ID " + to_string(id) + ") - " + message);
}
else {
log(level, "(ID:LUN " + to_string(id) + ":" + to_string(lun) + ") - " + message);
}
}
if ((log_device_id == -1 || log_device_id == id) && (lun == -1 || log_device_lun == -1 || log_device_lun == lun)) {
if (lun == -1) {
log(level, "(ID " + to_string(id) + ") - " + message);
}
else {
log(level, "(ID:LUN " + to_string(id) + ":" + to_string(lun) + ") - " + message);
}
}
}
void DeviceLogger::SetIdAndLun(int i, int l)