Hi

In logs we see all kind variations how an object is printed to the
users. E.g. for VMs we have seen, the DB ID, UUID, internal name, name
etc. in different debug log messages. And this makes debugging harder
than it should.

I wondered, why don't we just use the "toString()" in VO classes.

E.g in this PR
https://github.com/apache/cloudstack/pull/1252/files#diff-ab243638abf88707693d464b3b1836feR1503


We see a:

s_logger.debug("Host is in PrepareForMaintenance state - Stop VM
operation on the VM id: " + vm.getId() + " is not allowed");


With a toString in the VO class of the VM this would turn into

s_logger.debug("Host is in PrepareForMaintenance state - Stop VM
operation on the VM: " + vm + " is not allowed");

Did I miss anything?

René

Reply via email to