2021-11-13 11:29:08 +00:00
|
|
|
package logger
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"codeberg.org/gruf/go-nowish"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
clock = nowish.Clock{}
|
|
|
|
clockOnce = sync.Once{}
|
|
|
|
)
|
|
|
|
|
2021-11-27 14:26:58 +00:00
|
|
|
// startClock starts the global nowish clock.
|
2021-11-13 11:29:08 +00:00
|
|
|
func startClock() {
|
|
|
|
clockOnce.Do(func() {
|
2021-12-20 09:35:32 +00:00
|
|
|
clock.Start(time.Millisecond * 100)
|
2021-11-13 11:29:08 +00:00
|
|
|
clock.SetFormat("2006-01-02 15:04:05")
|
|
|
|
})
|
|
|
|
}
|