You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/11/03 11:18:58 UTC

[jira] [Commented] (CLOUDSTACK-9465) Several log refactoring/improvement suggestions

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-9465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15632412#comment-15632412 ] 

ASF subversion and git services commented on CLOUDSTACK-9465:
-------------------------------------------------------------

Commit b59db0dc06e0ef14f6c1a54ffcdc5578ed203007 in cloudstack's branch refs/heads/master from [~rohit.yadav@shapeblue.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=b59db0d ]

Merge pull request #1705 from nemo9cby/CLOUDSTACK-9465

Made the changes to improve logging.CLOUSTACK-9465 Several log refactoring/improvement suggestions.

There are two scenarios of logging which needs refactoring/improvement:

Method invocation replaced by variable

This means that in the logging code, the method invocation is pre-defined as a variable. for simplicity,          the method invocation should be replaced by the variable.

Delete variable which must be null

The variable in the logging code is null, there is no need to put the variable there.

* pr/1705:
  Made the changes to improve logging.

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


> Several log refactoring/improvement suggestions
> -----------------------------------------------
>
>                 Key: CLOUDSTACK-9465
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9465
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>    Affects Versions: 4.9.0
>            Reporter: Nemo Chen
>              Labels: easyfix, easytet
>         Attachments: CLOUDSTACK-9465.001.patch
>
>
> *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)