Standardization of logger usage

Registered by Tang Chen on 2016-06-01

There are many different places using different loggers. But they are used without rules.

Mainly there are three loggers:
- LOG = logging.getLogger(__name__)
- self.log
- self.app.log

Let's take an example first. In class ListNetwork in network.py,
- LOG will be "openstackclient.network.v2.network"
- self.log will be "openstackclient.network.v2.network.ListNetwork"
- self.app.log will be "openstackclient.shell"

As we can see in the source code, volume commands are mostly using self.app.log, while image commands are mostly using self.log. And network commands hardly record any log.

So we have two problems need to fix.
1. Set up rules to standardize logger usage, and fix all the incorrect usage in the source code.
2. Add missing logs to those who didn't log key info.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Tang Chen
Direction:
Needs approval
Assignee:
Tang Chen
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/log-usage,n,z

Addressed by: https://review.openstack.org/326257
    Standardize logger usage in volume

Addressed by: https://review.openstack.org/329809
    Add doc for logger usage

Addressed by: https://review.openstack.org/330878
    Standardize logger usage

Addressed by: https://review.openstack.org/333135
    Standardize logger usage of catalog in identity V2.0

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.