mirror of
https://github.com/openkmip/pykmip
synced 2025-12-20 10:13:18 +00:00
Removing default log configuration and usage
This change removes the use of default logging settings in kmip.__init__.py as well as the bundled logconfig.ini file. Logging settings should be set by applications, not by underlying software libraries. All demos have been updated to set their own logging settings and to log at appropriate levels.
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
from kmip.core import enums
|
||||
@@ -23,6 +22,8 @@ from kmip.pie import client
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
logger = utils.build_console_logger(logging.INFO)
|
||||
|
||||
# Build and parse arguments
|
||||
parser = utils.build_cli_parser(enums.Operation.GET_ATTRIBUTE_LIST)
|
||||
opts, args = parser.parse_args(sys.argv[1:])
|
||||
@@ -32,15 +33,9 @@ if __name__ == '__main__':
|
||||
|
||||
# Exit early if the UUID is not specified
|
||||
if uid is None:
|
||||
logging.debug('No ID provided, exiting early from demo')
|
||||
logger.error('No ID provided, exiting early from demo')
|
||||
sys.exit()
|
||||
|
||||
# Build and setup logging and needed factories
|
||||
f_log = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
|
||||
'logconfig.ini')
|
||||
logging.config.fileConfig(f_log)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Build the client and connect to the server
|
||||
with client.ProxyKmipClient(config=config) as client:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user