Skip to content

Commit

Permalink
Update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Nov 21, 2023
1 parent 0a29ee5 commit c17160f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cpp/devices/device_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ void DeviceLogger::Error(const string& message) const

void DeviceLogger::Log(level::level_enum level, const string& message) const
{
if (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)
Expand Down

0 comments on commit c17160f

Please sign in to comment.