1
0
mirror of https://github.com/beego/bee.git synced 2025-07-06 09:50:18 +00:00

Implementing the new logging infrastructure

Moved logging to the new logging infrastructure by removing the use of
ColorLog() function. Added more documentation. Also fixed some typos in
comments and function names.
This commit is contained in:
Faissal Elamraoui
2016-11-13 15:14:48 +01:00
parent 0e54238559
commit cf7aef47f0
26 changed files with 421 additions and 525 deletions

View File

@ -78,7 +78,7 @@ func getBeegoVersion() string {
return ""
}
if gopath == "" {
err = fmt.Errorf("You should set GOPATH env variable")
err = fmt.Errorf("You need to set GOPATH environment variable")
return ""
}
wgopath := path.SplitList(gopath)
@ -90,11 +90,11 @@ func getBeegoVersion() string {
if os.IsNotExist(err) {
continue
}
ColorLog("[ERRO] Get `beego.go` has error\n")
logger.Error("Error while getting stats of 'beego.go'")
}
fd, err := os.Open(filename)
if err != nil {
ColorLog("[ERRO] Open `beego.go` has error\n")
logger.Error("Error while reading 'beego.go'")
continue
}
reader := bufio.NewReader(fd)
@ -114,7 +114,7 @@ func getBeegoVersion() string {
}
}
return "Beego not installed. Please install it first: https://github.com/astaxie/beego"
return "Beego is not installed. Please do consider installing it first: https://github.com/astaxie/beego"
}
func getGoVersion() string {
@ -124,8 +124,7 @@ func getGoVersion() string {
)
if cmdOut, err = exec.Command("go", "version").Output(); err != nil {
fmt.Fprintln(os.Stderr, "There was an error running go version command:", err)
os.Exit(2)
logger.Fatalf("There was an error running go version command: %s", err)
}
return strings.Split(string(cmdOut), " ")[2]
}