cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (CLOUDSTACK-9465) Several log refactoring/improvement suggestions
Date Thu, 03 Nov 2016 11:18:58 GMT


ASF subversion and git services commented on CLOUDSTACK-9465:

Commit b59db0dc06e0ef14f6c1a54ffcdc5578ed203007 in cloudstack's branch refs/heads/master from
[;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 <>

> Several log refactoring/improvement suggestions
> -----------------------------------------------
>                 Key: CLOUDSTACK-9465
>                 URL:
>             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/
> 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/
> method: void orchestrateMigrateForScale (final String vmUuid, final long srcHostId, final
DeployDestination dest, final Long oldSvcOfferingId)
> {code}final long dstHostId = dest.getHost().getId();{code}
> {code}"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/
> 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

View raw message