51 lines
1.4 KiB
Go
51 lines
1.4 KiB
Go
package ytlogger
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
setup()
|
|
m.Run()
|
|
shutdown()
|
|
}
|
|
|
|
var ytLoggerConsole *YTLogger
|
|
|
|
//var ytLoggerNats *YTLogger
|
|
|
|
func setup() {
|
|
ytLoggerConsole = NewYTLogger(LOG_DEBUG, 100000, LogConsole)
|
|
}
|
|
|
|
func shutdown() {
|
|
ytLoggerConsole.Shutdown()
|
|
}
|
|
|
|
func TestPrintColors(t *testing.T) {
|
|
/*fmt.Println(ColorRed, " ColorRed")
|
|
fmt.Println(ColorGreen, " ColorGreen")
|
|
fmt.Println(ColorGreenBold, " ColorGreenBold")
|
|
fmt.Println(ColorYellow, " ColorYellow")
|
|
fmt.Println(ColorBlue, " ColorBlue")
|
|
fmt.Println(ColorMagenta, " ColorMagenta")
|
|
fmt.Println(ColorCyan, " ColorCyan")
|
|
fmt.Println(ColorWhite, " ColorWhite")
|
|
fmt.Println(ColorBlueBold, " ColorBlueBold")
|
|
fmt.Println(ColorMagentaBold, " ColorMagentaBold")
|
|
fmt.Println(ColorRedBold, " ColorRedBold")
|
|
fmt.Println(ColorYellowBold, " ColorYellowBold")
|
|
fmt.Println(ColorReset, " ColorReset")*/
|
|
}
|
|
|
|
func TestConsoleEmerg(t *testing.T) {
|
|
/*fmt.Println(time.Now().Unix())
|
|
fmt.Println(time.Now().UnixMilli())
|
|
fmt.Println(time.Now().UnixMicro())
|
|
fmt.Println(time.Now().UnixNano())
|
|
fmt.Println(time.Now().Nanosecond())*/
|
|
ytLoggerConsole.Emerg(&[]string{"test1"}[0], &[]string{"test2"}[0], &[]string{"test3"}[0], &[]string{"test4"}[0], &[]string{"test5"}[0], &[]time.Time{time.Now()}[0], &[]time.Time{time.Now()}[0], &[]string{"test6"}[0], &[]int32{0}[0], nil, nil, &[]int64{0}[0], &[]string{"test"}[0])
|
|
<-time.After(time.Second * 29)
|
|
}
|