Skip to content

Commit 1a0efe3

Browse files
author
shenbowei
committed
修改log debug开关变量
1 parent a0c0258 commit 1a0efe3

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

ssh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const (
1212
CISCO = "cisco"
1313
)
1414

15-
var Debug = true
15+
var IsLogDebug = true
1616

1717
/**
1818
* 外部调用的统一方法,完成获取会话(若不存在,则会创建连接和会话,并存放入缓存),执行指令的流程,返回执行结果
@@ -112,7 +112,7 @@ func filterResult(result, firstCmd string) string {
112112
}
113113

114114
func LogDebug(format string, a ...interface{}) {
115-
if Debug {
115+
if IsLogDebug {
116116
fmt.Println("[DEBUG]:" + fmt.Sprintf(format, a...))
117117
}
118118
}

ssh_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestSSHRunner(t *testing.T) {
1616
cmds = append(cmds, "dis clock")
1717
cmds = append(cmds, "dis clock")
1818

19-
Debug = false
19+
IsLogDebug = false
2020
result, err := RunCommandsWithBrand(user, password, ipPort, H3C, cmds...)
2121
if err != nil {
2222
LogError("RunCommands err:%s", err.Error())

0 commit comments

Comments
 (0)