fix: lifecycle-safe logger teardown without global state

Store file handle per module, swap lifecycle logger before closing file,
return teardown errors, remove duplicate Module() func.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-29 18:01:08 -07:00
parent 7fcb19ad49
commit 626e1bb5ac
9 changed files with 258 additions and 149 deletions
+5 -1
View File
@@ -3,12 +3,16 @@ module gitea.auvem.com/go-toolkit/applog
go 1.24.0
require (
gitea.auvem.com/go-toolkit/app v0.0.0-20250603235859-6f9e3731acf9
gitea.auvem.com/go-toolkit/app v0.0.0-1782781086-58e5e33e18da
github.com/lmittmann/tint v1.1.1
github.com/samber/slog-multi v1.4.0
github.com/stretchr/testify v1.10.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/samber/lo v1.49.1 // indirect
golang.org/x/text v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)