Add timestamps to debug output (#5)
This commit is contained in:
parent
f9a5db3525
commit
9f84e6a17a
6
main.go
6
main.go
|
@ -48,21 +48,21 @@ func main() {
|
||||||
fmt.Println("[ERROR]:", err)
|
fmt.Println("[ERROR]:", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Println("CPU:", cpu)
|
fmt.Printf("[%v] CPU: %v\n", time.Now().Format(time.RFC3339), cpu)
|
||||||
|
|
||||||
usedMem, err := src.MemStats()
|
usedMem, err := src.MemStats()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("[ERROR]:", err)
|
fmt.Println("[ERROR]:", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Println("Used Mem:", usedMem)
|
fmt.Printf("[%v] Used Mem: %v\n", time.Now().Format(time.RFC3339), usedMem)
|
||||||
|
|
||||||
rx, tx, err := src.Netstats()
|
rx, tx, err := src.Netstats()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("[ERROR]:", err)
|
fmt.Println("[ERROR]:", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf("Netstats (rx/tx): %v/%v bytes\n", rx, tx)
|
fmt.Printf("[%v] Netstats (rx/tx): %v/%v bytes\n", time.Now().Format(time.RFC3339), rx, tx)
|
||||||
|
|
||||||
time.Sleep(*interval)
|
time.Sleep(*interval)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue