about summary refs log tree commit diff
path: root/llog/llog.go
blob: 54620edbdd8b9a6ca52d7dd363d42abaec2bd5f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package llog

import (
	"fmt"
	"time"
)

// Good prints a "good" (green) message with a timestamp and the given message
func Good(text string) {
	fmt.Printf("%s\033[36m [+] \033[0m%-60s\t", currentTime(), text)
}

// Bad prints a "good" (green) message with a timestamp and the given message
func Bad(text string) {
	fmt.Printf("%s\033[31m [+] \033[0m%-60s\t", currentTime(), text)
}

// current_time returns the current time as a string in the HH:MM:SS format
func currentTime() string {
	t := time.Now()
	return fmt.Sprintf("%02d:%02d:%02d", t.Hour(), t.Minute(), t.Second())
}