diff --git a/Makefile b/Makefile index 5b47b1c..ab11c43 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ # git remote add github git@github.com:wit-go/log.git +redomod: + rm -f go.* + unset GO111MODULES && go mod init + unset GO111MODULES && go mod tidy + github: git push origin master git push origin devel diff --git a/flags.go b/flags.go index e885e24..7009970 100644 --- a/flags.go +++ b/flags.go @@ -22,7 +22,9 @@ type LogFlag struct { B bool Default bool // set at the time of Registration() Name string - Subsystem string + // TODO: figure out what package is sending the Registration + Subsystem string // probably should just be forced to be the package name + Short string // string actually printed on each line Desc string } @@ -132,11 +134,11 @@ func (f *LogFlag) Set(b bool) { func Set(subsystem string, name string, b bool) { flagsMutex.Lock() defer flagsMutex.Unlock() - Info("Set() TODO find var:", "(" + subsystem + ")", name, "=", b) + Verbose("log.Set() TODO find var:", "(" + subsystem + ")", name, "=", b) for _, f := range flags { - Log(true, "Set() ", "(" + f.Subsystem + ")", f.Name, "=", f.B, ":", f.Desc) + Verbose("log.Set() ", "(" + f.Subsystem + ")", f.Name, "=", f.B, ":", f.Desc) if (subsystem == f.Subsystem) && (name == f.Name) { - Log(true, "Set() FOUND ", f) + Verbose("log.Set() FOUND ", f) f.B = b return } @@ -147,11 +149,11 @@ func Set(subsystem string, name string, b bool) { func Get(subsystem string, name string) bool { flagsMutex.Lock() defer flagsMutex.Unlock() - Info("Get() TODO find var:", "(" + subsystem + ")", name) + Verbose("log.Get() TODO find var:", "(" + subsystem + ")", name) for _, f := range flags { - Log(true, "Get() ", "(" + f.Subsystem + ")", f.Name, "=", f.B, ":", f.Desc) + Verbose("log.Get() ", "(" + f.Subsystem + ")", f.Name, "=", f.B, ":", f.Desc) if (subsystem == f.Subsystem) && (name == f.Name) { - Log(true, "Get() FOUND ", f) + Verbose("log.Get() FOUND ", f) return f.B } } diff --git a/go.mod b/go.mod index 8c124e2..243bc19 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module go.wit.com/log go 1.21.4 -require github.com/davecgh/go-spew v1.1.1 +require go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9 diff --git a/go.sum b/go.sum index b5e2922..6a0c10c 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9 h1:UEX2EzLQPzLTfy/kUFQD7OXtvKn8wk/+jpDOkbl4ff4= +go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9/go.mod h1:qBpgJXThMMT15vym7/E4Ur9y8oOo2nP7t2RP52QHUNw=