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
+6
View File
@@ -0,0 +1,6 @@
// Package applog configures slog for [gitea.auvem.com/go-toolkit/app.Lifecycle]
// with optional JSON file output and tint console formatting.
//
// Teardown closes the log file and re-points the lifecycle logger to console-only
// (or discard if console is disabled) so post-teardown lifecycle logs remain safe.
package applog