Skip to content

Commit

Permalink
Merge pull request kubernetes#1626 from hello2mao/use-klog-for-debug-log
Browse files Browse the repository at this point in the history
Use klog instead of log
  • Loading branch information
k8s-ci-robot authored Feb 2, 2019
2 parents 6409124 + b0079ac commit 52e2cf4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
"net/url"
"os"
Expand All @@ -42,6 +41,8 @@ import (
"strconv"
"strings"
"time"

"k8s.io/klog"
)

// GetURL gets the full URL for a http request.
Expand Down Expand Up @@ -562,13 +563,13 @@ func dirWindows() (string, error) {
// Debug generates debug info for debug mode.
func Debug(title, message string) {
if title != "" {
log.Println("----------------------------DEBUG: start of " + title + "----------------------------")
klog.V(5).Infof("----------------------------DEBUG: start of %s ----------------------------", title)
}

log.Println(message)
klog.V(5).Infof(message)

if title != "" {
log.Println("----------------------------DEBUG: end of " + title + "------------------------------\n")
klog.V(5).Infof("----------------------------DEBUG: end of %s------------------------------", title)
}
}

Expand Down

0 comments on commit 52e2cf4

Please sign in to comment.