package main

import (
	"fmt"
	"sync"
	"time"
)

var logMu sync.Mutex

func logMsg(msg string) {
	logPrintf("%s\n", msg)
}

func logPrintf(format string, a ...any) {
	logMu.Lock()
	fmt.Printf(time.Now().Format("2006-01-02 15:04:05")+" "+format, a...)
	logMu.Unlock()
}

func logMsgf(format string, a ...any) {
	logPrintf(format+"\n", a...)
}
