Skip to content

Instantly share code, notes, and snippets.

View anteaya's full-sized avatar

Anita Kuno anteaya

View GitHub Profile
$ python logging_example_03.py
CRITICAL:__main__:foo was called
WARNING:__main__:this is a warning message
INFO:__main__:this is some information, hope it is helpful
ERROR:__main__:this is an error
Hello World!
import logging
logging.basicConfig(level=logging.INFO)
LOG = logging.getLogger(__name__)
def foo():
LOG.critical("foo was called")
LOG.debug("this message output from debug")
LOG.warning("this is a warning message")
$ python logging_example_02.py
CRITICAL:__main__:foo was called
WARNING:__main__:this is a warning message
ERROR:__main__:this is an error
Hello World!
import logging
logging.basicConfig()
LOG = logging.getLogger(__name__)
def foo():
LOG.critical("foo was called")
LOG.debug("this message output from debug")
LOG.warning("this is a warning message")
$ python logging_example_01.py
CRITICAL:__main__:foo was called
Hello
import logging
logging.basicConfig()
LOG = logging.getLogger(__name__)
def foo():
LOG.critical("foo was called")
print "Hello World!"
'magic_tuple' is not defined
self.auth_url == http://50.56.25.223:5000/v2.0
self == <novaclient.client.HTTPClient object at 0x1f39450>
magic_tuple = urlparse.urlsplit(self.auth_url)
for index, key in enumerate(keys):
'keyring_key' is not defined
keys == ['http://50.56.25.223:5000/v2.0', 'admin', 'admin', '?', 'publicURL', 'compute', '?', '?']
keyring_key = "/".join(keys)
keyring_key == http://50.56.25.223:5000/v2.0/admin/admin/?/publicURL/compute/?/?
self.os_cache == False
self.used_keyring == False
for index, key in enumerate(keys): #key == None; index == 7
if key is None:
#keys[index] == None
keys[index] = '?' #keys[index] == ?
for index, key in enumerate(keys): #key == publicURL; index == 4
if key is None:
for index, key in enumerate(keys): #key == compute; index == 5
if key is None:
for index, key in enumerate(keys): #key == None; index == 6
if key is None:
#keys[index] == None
keys[index] = '?' #keys[index] == ?