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

Method Fatal

cli/pkg/common/log.go:199–222  ·  view source on GitHub ↗
(fatal interface{}, headers ...string)

Source from the content-addressed store, hash-verified

197}
198
199func (sLog *smartIDELogStruct) Fatal(fatal interface{}, headers ...string) {
200 if fatal != nil {
201 // 基本信息
202 contents := headers
203 contents = append(contents, fmt.Sprint(fatal))
204
205 // 前缀
206 prefix := getPrefix(zapcore.FatalLevel)
207 contents = append([]string{prefix}, contents...)
208
209 // 堆栈
210 stack := string(debug.Stack())
211 contents = append(contents, stack)
212 contents = RemoveDuplicatesAndEmpty(contents) // 去重
213 contents = entryptionKeys(contents) // 加密密钥
214
215 // 打印日志
216 fmt.Println(strings.Join(contents, "; "))
217
218 // 记录日志
219 sugarLogger.Fatal(strings.Join(contents, "; "))
220 os.Exit(1)
221 }
222}
223
224func (sLog *smartIDELogStruct) Info(args ...string) {
225 args = RemoveDuplicatesAndEmpty(args)

Callers 15

mainFunction · 0.80
TestIOErrorFunction · 0.80
CopyFileMethod · 0.80
RunCmdFunction · 0.80
getLogWriterFunction · 0.80
dockerCreateAndRunFunction · 0.80
AutoTunnelFunction · 0.80
SaveTempFilesMethod · 0.80
getTempConfigFilePathFunction · 0.80
ConfigGitByDockerExecFunction · 0.80
GitConfigFunction · 0.80

Calls 4

getPrefixFunction · 0.85
RemoveDuplicatesAndEmptyFunction · 0.85
entryptionKeysFunction · 0.85
JoinMethod · 0.45

Tested by 1

TestIOErrorFunction · 0.64