2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-14 07:13:20 +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:
Peter
2016-03-31 12:40:47 -04:00
parent a3da0c6d46
commit 4bc27425be
24 changed files with 82 additions and 195 deletions

View File

@@ -13,6 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import binascii
import logging
import optparse
import sys
from kmip.core.attributes import CryptographicAlgorithm
from kmip.core.attributes import CryptographicLength
@@ -38,9 +43,17 @@ from kmip.core.secrets import PublicKey
from kmip.core.secrets import SymmetricKey
from kmip.core.secrets import SecretData
import binascii
import optparse
import sys
def build_console_logger(level):
logger = logging.getLogger('demo')
logger.setLevel(level)
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
handler.setFormatter(formatter)
logger.addHandler(handler)
return logger
def build_cli_parser(operation=None):