1
0
mirror of https://github.com/beego/bee.git synced 2025-07-03 15:20:17 +00:00

Update color ouput

This commit is contained in:
Unknown
2013-08-15 15:24:23 +08:00
parent a6840ebafd
commit 055609f64d
4 changed files with 22 additions and 9 deletions

View File

@ -20,7 +20,8 @@ var (
func NewWatcher(paths []string) {
watcher, err := fsnotify.NewWatcher()
if err != nil {
log.Fatal(err)
colorLog("[ERRO] Fail to create new Watcher[ %s ]\n", err)
os.Exit(2)
}
go func() {
@ -39,7 +40,7 @@ func NewWatcher(paths []string) {
mt := getFileModTime(e.Name)
if t := eventTime[e.Name]; mt == t {
colorLog("[SKIP] %s\n", e.String())
colorLog("[SKIP] # %s #\n", e.String())
isbuild = false
}
@ -57,10 +58,11 @@ func NewWatcher(paths []string) {
colorLog("[INFO] Initializing watcher...\n")
for _, path := range paths {
fmt.Println(path)
colorLog("[TRAC] Directory( %s )\n", path)
err = watcher.Watch(path)
if err != nil {
log.Fatal(err)
colorLog("[ERRO] Fail to watch directory[ %s ]\n", err)
os.Exit(2)
}
}