MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / Debug

Method Debug

cli/pkg/common/log.go:285–325  ·  view source on GitHub ↗
(args ...string)

Source from the content-addressed store, hash-verified

283}
284
285func (sLog *smartIDELogStruct) Debug(args ...string) {
286
287 args = RemoveDuplicatesAndEmpty(args)
288 if len(args) <= 0 {
289 return
290 }
291
292 msg := strings.Join(args, " ")
293 msg = entryptionKey(msg) // 加密
294
295 prefix := getPrefix(zapcore.DebugLevel)
296 if isDebugLevel {
297
298 if isRepeat(msg, zapcore.DebugLevel) { // 是否重复
299 return
300 } else {
301 fmt.Println(prefix, msg)
302 }
303
304 }
305 if sLog.Ws_id != "" {
306 ch <- struct{}{}
307 WG.Add(1)
308 go func() {
309 SendAndReceive("business", "workspaceLog", "", "", model.WorkspaceLog{
310 Title: "",
311 ParentId: sLog.ParentId,
312 Content: msg,
313 Ws_id: sLog.Ws_id,
314 Level: 3,
315 Type: 1,
316 StartAt: time.Now(),
317 EndAt: time.Now(),
318 })
319
320 defer WG.Done()
321 <-ch
322 }()
323 }
324 sugarLogger.Debug(msg)
325}
326
327// 输出到控制台,但是不加任何的修饰
328func (sLog *smartIDELogStruct) Console(args ...interface{}) {

Callers 15

StartAgentMethod · 0.80
ExecKubectlCommandMethod · 0.80
checkAndInstallKubectlFunction · 0.80
getMethod · 0.80
putMethod · 0.80
postMethod · 0.80
parsingResponseFunction · 0.80
GetRemoteUserInfoMethod · 0.80

Calls 6

RemoveDuplicatesAndEmptyFunction · 0.85
entryptionKeyFunction · 0.85
getPrefixFunction · 0.85
isRepeatFunction · 0.85
SendAndReceiveFunction · 0.85
JoinMethod · 0.45

Tested by

no test coverage detected