summaryrefslogtreecommitdiff
path: root/flags.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-27 09:02:42 -0600
committerJeff Carr <[email protected]>2024-01-27 09:02:42 -0600
commit53f2462b3213ad7983fd315e0d98c202717b7d44 (patch)
tree88e6c75b0f957e53776fb711bfe0d4b5b96b1920 /flags.go
parent7371f0428fad167e9a1762e08ac3c1e97901b01a (diff)
nocui works correctlyv0.13.0
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'flags.go')
-rw-r--r--flags.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/flags.go b/flags.go
index 52a2ac6..d61f33f 100644
--- a/flags.go
+++ b/flags.go
@@ -40,6 +40,7 @@ var ERROR *LogFlag // toggles log.Warn() (true by default)
var PRINTLN *LogFlag // toggles log.Println() (true by default)
var always *LogFlag
+var allon bool = false
// writeMutex protects locks the write process
var flagsMutex sync.Mutex
@@ -103,6 +104,7 @@ func (f *LogFlag) Ok() bool {
func SetAll(b bool) {
flagsMutex.Lock()
defer flagsMutex.Unlock()
+ allon = b
for _, f := range flags {
f.b = b
}
@@ -187,7 +189,11 @@ func NewFlag(name string, b bool, full, short, desc string) *LogFlag {
defer flagsMutex.Unlock()
f := new(LogFlag)
Log(always, "log.SetFlag() ", full, short, name, true)
- f.b = b
+ if allon {
+ f.b = true
+ } else {
+ f.b = b
+ }
f.orig = b
f.short = short
f.subsystem = full