MCPcopy Create free account
hub / github.com/BishopFox/cloudfox / GetLogDirPath

Function GetLogDirPath

internal/log.go:26–38  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

24// This function returns ~/.cloudfox.
25// If the folder does not exist the function creates it.
26func 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
40type Logger struct {
41 version string

Callers 6

AzWhoamiCommandFunction · 0.92
aws.goFile · 0.92
TestDatabasesCommandFunction · 0.92
TestApiGwFunction · 0.92
TxtLoggerFunction · 0.85
SpinUntilFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestDatabasesCommandFunction · 0.74
TestApiGwFunction · 0.74