2024-10-21 20:47:02 +09:00
|
|
|
package fmsg
|
|
|
|
|
2024-10-26 23:09:32 +09:00
|
|
|
import "sync/atomic"
|
|
|
|
|
|
|
|
var verbose = new(atomic.Bool)
|
|
|
|
|
2024-10-21 20:47:02 +09:00
|
|
|
func Verbose() bool {
|
|
|
|
return verbose.Load()
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetVerbose(v bool) {
|
|
|
|
verbose.Store(v)
|
|
|
|
}
|
|
|
|
|
|
|
|
func VPrintf(format string, v ...any) {
|
|
|
|
if verbose.Load() {
|
2024-10-26 23:09:32 +09:00
|
|
|
Printf(format, v...)
|
2024-10-21 20:47:02 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func VPrintln(v ...any) {
|
|
|
|
if verbose.Load() {
|
2024-10-26 23:09:32 +09:00
|
|
|
Println(v...)
|
2024-10-21 20:47:02 +09:00
|
|
|
}
|
|
|
|
}
|