-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
33 lines (27 loc) · 935 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"github.com/kataras/golog"
)
func main() {
// First argument is the raw text for outputs
// that are not support colors,
// second argument is the full colorful text (yes it can be different if you wish to).
//
// If the second argument is empty then golog will update the colorful text to the
// default color (i.e red on ErrorText) based on the first argument.
// Default is "[ERRO]"
golog.ErrorText("|ERROR|", "")
// Default is "[WARN]"
golog.WarnText("|WARN|", "")
// Default is "[INFO]"
golog.InfoText("|INFO|", "")
// Default is "[DBUG]"
golog.DebugText("|DEBUG|", "")
// Business as usual...
golog.SetLevel("debug")
golog.Println("This is a raw message, no levels, no colors.")
golog.Info("This is an info message, with colors (if the output is terminal)")
golog.Warn("This is a warning message")
golog.Error("This is an error message")
golog.Debug("This is a debug message")
}