Martin Peřina has uploaded a new change for review. Change subject: tools: Replace oVirt logger with slf4j as frontend in engine-config ......................................................................
tools: Replace oVirt logger with slf4j as frontend in engine-config Replaces oVirt logger with slf4j as logging frontend in classes which are used in engine-config tool. Change-Id: I1aeac803a58fc74919c88ac8c7ac4e3084747ce9 Bug-Url: https://bugzilla.redhat.com/1109871 Signed-off-by: Martin Perina <mper...@redhat.com> --- M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java M backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/ssh/OpenSSHUtils.java 2 files changed, 10 insertions(+), 15 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/29/33929/1 diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java index 7f33333..200cb40 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java @@ -14,17 +14,12 @@ import javax.net.ssl.TrustManagerFactory; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.ovirt.engine.core.common.config.Config; import org.ovirt.engine.core.common.config.ConfigValues; import org.ovirt.engine.core.utils.EngineLocalConfig; import org.ovirt.engine.core.uutils.ssh.OpenSSHUtils; public class EngineEncryptionUtils { - - private static final Log log = LogFactory.getLog(EngineEncryptionUtils.class); - private static final String keystoreType; private static final File keystoreFile; private static final KeyStore.PasswordProtection keystorePassword; diff --git a/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/ssh/OpenSSHUtils.java b/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/ssh/OpenSSHUtils.java index 0820685..3a92b59 100644 --- a/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/ssh/OpenSSHUtils.java +++ b/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/ssh/OpenSSHUtils.java @@ -9,12 +9,12 @@ import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class OpenSSHUtils { // The log: - private static final Log log = LogFactory.getLog(OpenSSHUtils.class); + private static final Logger log = LoggerFactory.getLogger(OpenSSHUtils.class); // Names of supported algorithms: private static final String SSH_RSA = "ssh-rsa"; @@ -45,8 +45,8 @@ final byte[] exponentBytes = rsaKey.getPublicExponent().toByteArray(); final byte[] modulusBytes = rsaKey.getModulus().toByteArray(); if (log.isDebugEnabled()) { - log.debug("Exponent is " + rsaKey.getPublicExponent() + " (" + Hex.encodeHexString(exponentBytes) + ")."); - log.debug("Modulus is " + rsaKey.getModulus() + " (" + Hex.encodeHexString(exponentBytes) + ")."); + log.debug("Exponent is {} ({}).", rsaKey.getPublicExponent(), Hex.encodeHexString(exponentBytes)); + log.debug("Modulus is {} ({}).", rsaKey.getModulus(), Hex.encodeHexString(exponentBytes)); } try { @@ -73,7 +73,7 @@ binaryOut.close(); final byte[] keyBytes = binaryOut.toByteArray(); if (log.isDebugEnabled()) { - log.debug("Key bytes are " + Hex.encodeHexString(keyBytes) + "."); + log.debug("Key bytes are {}.", Hex.encodeHexString(keyBytes)); } return keyBytes; @@ -109,7 +109,7 @@ final Base64 encoder = new Base64(0); final String encoding = encoder.encodeToString(keyBytes); if (log.isDebugEnabled()) { - log.debug("Key encoding is \"" + encoding + "\"."); + log.debug("Key encoding is \"{}\".", encoding); } // Return the generated SSH public key: @@ -124,7 +124,7 @@ buffer.append('\n'); final String keyString = buffer.toString(); if (log.isDebugEnabled()) { - log.debug("Key string is \"" + keyString + "\"."); + log.debug("Key string is \"{}\".", keyString); } return keyString; @@ -152,7 +152,7 @@ // The fingerprint is a MD5 digest of the key bytes: final byte[] fingerprintBytes = DigestUtils.md5(keyBytes); if (log.isDebugEnabled()) { - log.debug("Fingerprint bytes are " + Hex.encodeHexString(fingerprintBytes) + "."); + log.debug("Fingerprint bytes are {}.", Hex.encodeHexString(fingerprintBytes)); } return fingerprintBytes; @@ -186,7 +186,7 @@ } final String fingerprintString = buffer.toString(); if (log.isDebugEnabled()) { - log.debug("Fingerprint string is \"" + fingerprintString + "\"."); + log.debug("Fingerprint string is \"{}\".", fingerprintString); } return fingerprintString; -- To view, visit http://gerrit.ovirt.org/33929 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1aeac803a58fc74919c88ac8c7ac4e3084747ce9 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Peřina <mper...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches