Note: clearln is defined in aws.go as "\r\x1b[2K" and is used to clear spinner status lines This function returns ~/.cloudfox. If the folder does not exist the function creates it.
()
| 24 | // This function returns ~/.cloudfox. |
| 25 | // If the folder does not exist the function creates it. |
| 26 | func GetLogDirPath() *string { |
| 27 | user, _ := user.Current() |
| 28 | dir := filepath.Join(user.HomeDir, globals.CLOUDFOX_LOG_FILE_DIR_NAME) |
| 29 | if _, err := os.Stat(dir); os.IsNotExist(err) { |
| 30 | err = os.MkdirAll(dir, 0700) |
| 31 | if err != nil { |
| 32 | log.Printf("[-] Failed to read or create cloudfox directory") |
| 33 | dir, err = os.Getwd() |
| 34 | return ptr.String(dir) |
| 35 | } |
| 36 | } |
| 37 | return ptr.String(dir) |
| 38 | } |
| 39 | |
| 40 | type Logger struct { |
| 41 | version string |
no outgoing calls