mirror of https://github.com/OpenKMIP/PyKMIP.git
Merge pull request #15 from OpenKMIP/feat/update-client-demo-logging
Updating client and demo logging
This commit is contained in:
commit
e5043ec193
|
@ -38,7 +38,7 @@ else:
|
|||
},
|
||||
'handlers': {
|
||||
'consoleHandler': {
|
||||
'level': 'DEBUG',
|
||||
'level': 'INFO',
|
||||
'class': 'logging.StreamHandler',
|
||||
'formatter': 'simpleFormatter',
|
||||
'stream': sys.stdout
|
||||
|
@ -46,7 +46,7 @@ else:
|
|||
},
|
||||
'loggers': {
|
||||
'root': {
|
||||
'level': 'DEBUG',
|
||||
'level': 'INFO',
|
||||
'handlers': ['consoleHandler']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,17 +121,17 @@ if __name__ == '__main__':
|
|||
client.close()
|
||||
|
||||
# Display operation results
|
||||
logger.debug('create() result status: {0}'.format(
|
||||
logger.info('create() result status: {0}'.format(
|
||||
result.result_status.enum))
|
||||
|
||||
if result.result_status.enum == ResultStatus.SUCCESS:
|
||||
logger.debug('created object type: {0}'.format(
|
||||
logger.info('created object type: {0}'.format(
|
||||
result.object_type.enum))
|
||||
logger.debug('created UUID: {0}'.format(result.uuid.value))
|
||||
logger.debug('created template attribute: {0}'.
|
||||
format(result.template_attribute))
|
||||
logger.info('created UUID: {0}'.format(result.uuid.value))
|
||||
logger.info('created template attribute: {0}'.
|
||||
format(result.template_attribute))
|
||||
else:
|
||||
logger.debug('create() result reason: {0}'.format(
|
||||
logger.info('create() result reason: {0}'.format(
|
||||
result.result_reason.enum))
|
||||
logger.debug('create() result message: {0}'.format(
|
||||
logger.info('create() result message: {0}'.format(
|
||||
result.result_message.value))
|
||||
|
|
|
@ -72,13 +72,13 @@ if __name__ == '__main__':
|
|||
client.close()
|
||||
|
||||
# Display operation results
|
||||
logger.debug('destroy() result status: {0}'.format(
|
||||
logger.info('destroy() result status: {0}'.format(
|
||||
result.result_status.enum))
|
||||
|
||||
if result.result_status.enum == ResultStatus.SUCCESS:
|
||||
logger.debug('destroyed UUID: {0}'.format(result.uuid.value))
|
||||
logger.info('destroyed UUID: {0}'.format(result.uuid.value))
|
||||
else:
|
||||
logger.debug('destroy() result reason: {0}'.format(
|
||||
logger.info('destroy() result reason: {0}'.format(
|
||||
result.result_reason.enum))
|
||||
logger.debug('destroy() result message: {0}'.format(
|
||||
logger.info('destroy() result message: {0}'.format(
|
||||
result.result_message.value))
|
||||
|
|
|
@ -48,21 +48,21 @@ if __name__ == '__main__':
|
|||
client.close()
|
||||
|
||||
# Display operation results
|
||||
logger.debug('discover_versions() result status: {0}'.format(
|
||||
logger.info('discover_versions() result status: {0}'.format(
|
||||
result.result_status.enum))
|
||||
|
||||
if result.result_status.enum == ResultStatus.SUCCESS:
|
||||
protocol_versions = result.protocol_versions
|
||||
if isinstance(protocol_versions, list):
|
||||
logger.debug('number of protocol versions returned: {0}'.format(
|
||||
logger.info('number of protocol versions returned: {0}'.format(
|
||||
len(protocol_versions)))
|
||||
for protocol_version in protocol_versions:
|
||||
logging.debug('protocol version supported: {0}'.format(
|
||||
protocol_version))
|
||||
logger.info('protocol version supported: {0}'.format(
|
||||
protocol_version))
|
||||
else:
|
||||
logger.debug('number of protocol versions returned: 0')
|
||||
logger.info('number of protocol versions returned: 0')
|
||||
else:
|
||||
logger.debug('discover_versions() result reason: {0}'.format(
|
||||
logger.info('discover_versions() result reason: {0}'.format(
|
||||
result.result_reason.enum))
|
||||
logger.debug('discover_versions() result message: {0}'.format(
|
||||
logger.info('discover_versions() result message: {0}'.format(
|
||||
result.result_message.value))
|
||||
|
|
|
@ -91,17 +91,17 @@ if __name__ == '__main__':
|
|||
client.close()
|
||||
|
||||
# Display operation results
|
||||
logger.debug('get() result status: {0}'.format(
|
||||
logger.info('get() result status: {0}'.format(
|
||||
result.result_status.enum))
|
||||
|
||||
if result.result_status.enum == ResultStatus.SUCCESS:
|
||||
logger.debug('retrieved object type: {0}'.format(
|
||||
logger.info('retrieved object type: {0}'.format(
|
||||
result.object_type.enum))
|
||||
logger.debug('retrieved UUID: {0}'.format(result.uuid.value))
|
||||
logger.info('retrieved UUID: {0}'.format(result.uuid.value))
|
||||
|
||||
utils.log_secret(logger, result.object_type.enum, result.secret)
|
||||
else:
|
||||
logger.debug('get() result reason: {0}'.format(
|
||||
logger.info('get() result reason: {0}'.format(
|
||||
result.result_reason.enum))
|
||||
logger.debug('get() result message: {0}'.format(
|
||||
logger.info('get() result message: {0}'.format(
|
||||
result.result_message.value))
|
||||
|
|
|
@ -87,15 +87,15 @@ if __name__ == '__main__':
|
|||
client.close()
|
||||
|
||||
# Display operation results
|
||||
logger.debug('locate() result status: {0}'.format(
|
||||
logger.info('locate() result status: {0}'.format(
|
||||
result.result_status.enum))
|
||||
|
||||
if result.result_status.enum == ResultStatus.SUCCESS:
|
||||
logger.debug('located UUIDs:')
|
||||
logger.info('located UUIDs:')
|
||||
for uuid in result.uuids:
|
||||
logging.debug('{0}'.format(uuid))
|
||||
logger.info('{0}'.format(uuid))
|
||||
else:
|
||||
logger.debug('get() result reason: {0}'.format(
|
||||
logger.info('get() result reason: {0}'.format(
|
||||
result.result_reason.enum))
|
||||
logger.debug('get() result message: {0}'.format(
|
||||
logger.info('get() result message: {0}'.format(
|
||||
result.result_message.value))
|
||||
|
|
|
@ -72,15 +72,15 @@ if __name__ == '__main__':
|
|||
client.close()
|
||||
|
||||
# Display operation results
|
||||
logger.debug('register() result status: {0}'.format(
|
||||
logger.info('register() result status: {0}'.format(
|
||||
result.result_status.enum))
|
||||
|
||||
if result.result_status.enum == ResultStatus.SUCCESS:
|
||||
logger.debug('registered UUID: {0}'.format(result.uuid.value))
|
||||
logger.debug('registered template attribute: {0}'.
|
||||
format(result.template_attribute))
|
||||
logger.info('registered UUID: {0}'.format(result.uuid.value))
|
||||
logger.info('registered template attribute: {0}'.
|
||||
format(result.template_attribute))
|
||||
else:
|
||||
logger.debug('register() result reason: {0}'.format(
|
||||
logger.info('register() result reason: {0}'.format(
|
||||
result.result_reason.enum))
|
||||
logger.debug('register() result message: {0}'.format(
|
||||
logger.info('register() result message: {0}'.format(
|
||||
result.result_message.value))
|
||||
|
|
|
@ -8,12 +8,12 @@ keys=consoleHandler
|
|||
keys=simpleFormatter
|
||||
|
||||
[logger_root]
|
||||
level=DEBUG
|
||||
level=INFO
|
||||
handlers=consoleHandler
|
||||
|
||||
[handler_consoleHandler]
|
||||
class=StreamHandler
|
||||
level=DEBUG
|
||||
level=INFO
|
||||
formatter=simpleFormatter
|
||||
args=(sys.stdout,)
|
||||
|
||||
|
|
Loading…
Reference in New Issue