Skip to content

Commit c4ed0e4

Browse files
committed
Fix formatted logging calls.
These pass format strings, but don't call the formatting version of the function.
1 parent 5fc50ce commit c4ed0e4

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

api/crl/crl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func NewHandler(dbAccessor certdb.Accessor, caPath string, caKeyPath string) (ht
5151
// Parse the key given
5252
key, err := helpers.ParsePrivateKeyPEMWithPassword(caKey, password)
5353
if err != nil {
54-
log.Debug("malformed private key %v", err)
54+
log.Debugf("malformed private key %v", err)
5555
return nil, err
5656
}
5757

api/gencrl/gencrl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ func gencrlHandler(w http.ResponseWriter, r *http.Request) error {
8080

8181
key, err := helpers.ParsePrivateKeyPEM([]byte(req.PrivateKey))
8282
if err != nil {
83-
log.Debug("malformed private key %v", err)
83+
log.Debugf("malformed private key %v", err)
8484
return errors.NewBadRequestString("malformed Private Key")
8585
}
8686

8787
result, err := cert.CreateCRL(rand.Reader, key, revokedCerts, time.Now(), newExpiryTime)
8888
if err != nil {
89-
log.Debug("unable to create CRL: %v", err)
89+
log.Debugf("unable to create CRL: %v", err)
9090
return err
9191
}
9292

cli/crl/crl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func generateCRL(c cli.Config) (crlBytes []byte, err error) {
7474
// Parse the key given
7575
key, err := helpers.ParsePrivateKeyPEMWithPassword(cakey, password)
7676
if err != nil {
77-
log.Debug("malformed private key %v", err)
77+
log.Debugf("malformed private key %v", err)
7878
return nil, err
7979
}
8080

crl/crl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func NewCRLFromFile(serialList, issuerFile, keyFile []byte, expiryTime string) (
6767
// Parse the key given
6868
key, err := helpers.ParsePrivateKeyPEMWithPassword(keyFile, password)
6969
if err != nil {
70-
log.Debug("Malformed private key %v", err)
70+
log.Debugf("Malformed private key %v", err)
7171
return nil, err
7272
}
7373

@@ -100,7 +100,7 @@ func NewCRLFromDB(certs []certdb.CertificateRecord, issuerCert *x509.Certificate
100100
func CreateGenericCRL(certList []pkix.RevokedCertificate, key crypto.Signer, issuingCert *x509.Certificate, expiryTime time.Time) ([]byte, error) {
101101
crlBytes, err := issuingCert.CreateCRL(rand.Reader, key, certList, time.Now(), expiryTime)
102102
if err != nil {
103-
log.Debug("error creating CRL: %s", err)
103+
log.Debugf("error creating CRL: %s", err)
104104
}
105105

106106
return crlBytes, err

helpers/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ func LoadClientCertificate(certFile string, keyFile string) (*tls.Certificate, e
473473
if certFile != "" && keyFile != "" {
474474
cert, err := tls.LoadX509KeyPair(certFile, keyFile)
475475
if err != nil {
476-
log.Critical("Unable to read client certificate from file: %s or key from file: %s", certFile, keyFile)
476+
log.Criticalf("Unable to read client certificate from file: %s or key from file: %s", certFile, keyFile)
477477
return nil, err
478478
}
479479
log.Debug("Client certificate loaded ")

ocsp/ocsp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func NewSignerFromFile(issuerFile, responderFile, keyFile string, interval time.
135135

136136
key, err := helpers.ParsePrivateKeyPEM(keyBytes)
137137
if err != nil {
138-
log.Debug("Malformed private key %v", err)
138+
log.Debugf("Malformed private key %v", err)
139139
return nil, err
140140
}
141141

signer/local/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func NewSignerFromFile(caFile, caKeyFile string, policy *config.Signing) (*Signe
119119

120120
priv, err := helpers.ParsePrivateKeyPEMWithPassword(cakey, password)
121121
if err != nil {
122-
log.Debug("Malformed private key %v", err)
122+
log.Debugf("Malformed private key %v", err)
123123
return nil, err
124124
}
125125

transport/listener.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (l *Listener) AutoUpdate(certUpdates chan<- time.Time, errChan chan<- error
9494

9595
config, err := l.getConfig()
9696
if err != nil {
97-
log.Debug("immediately after getting a new certificate, the Transport is reporting errors: %v", err)
97+
log.Debugf("immediately after getting a new certificate, the Transport is reporting errors: %v", err)
9898
if errChan != nil {
9999
errChan <- err
100100
}
@@ -104,7 +104,7 @@ func (l *Listener) AutoUpdate(certUpdates chan<- time.Time, errChan chan<- error
104104
lnet := l.Listener.Addr().Network()
105105
l.Listener, err = tls.Listen(lnet, address, config)
106106
if err != nil {
107-
log.Debug("immediately after getting a new certificate, the Transport is reporting errors: %v", err)
107+
log.Debugf("immediately after getting a new certificate, the Transport is reporting errors: %v", err)
108108
if errChan != nil {
109109
errChan <- err
110110
}

0 commit comments

Comments
 (0)