Nemo Chen created CLOUDSTACK-9465: ------------------------------------- Summary: Several log refactoring/improvement suggestions Key: CLOUDSTACK-9465 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9465 Project: CloudStack Issue Type: Bug Security Level: Public (Anyone can view this level - this is the default.) Affects Versions: 4.9.0 Reporter: Nemo Chen
*method invocation replaced by variable* file: apache-cloudstack-4.9.0-src/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java void processRequest (final Link link, final Request request) {code}final long hostId=attache.getId(){code} {code}s_logger.trace("SeqA " + attache.getId() + "-"+ request.getSequence()+ ": Processing "+ request);{code} file: apache-cloudstack-4.9.0-src/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java method: void orchestrateMigrateForScale (final String vmUuid, final long srcHostId, final DeployDestination dest, final Long oldSvcOfferingId) {code}final long dstHostId = dest.getHost().getId();{code} {code}s_logger.info("Source and destination host are not in same cluster, unable to migrate to host: " + dest.getHost().getId());{code} The method invocations in above examples are assigned to variables before, we should replace the method invocation with the variable for simpliciy and readabiliy of logs. ---- *Delete variable which must be null* apache-cloudstack-4.9.0-src/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAChecker.java Boolean checkingHB () {code}s_logger.debug("read heartbeat failed: " + result);{code} In the above example, the variable is null in the log. There is no need to print the invalid variable in the logs. Suggestion: delete the variable in the logs to avoid confusion. -- This message was sent by Atlassian JIRA (v6.3.4#6332)