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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user