refactor(log): split location into package/file/class/method, auto-derived
Per the log schema: 'package' is the Go package (absent on Python-emitted lines), 'file' the Go/Python source basename, 'class' the Go receiver or Python class (omitted when there is none -- free functions no longer masquerade under a package-as-class), 'method' the emitting function. applog.App() now takes no arguments and derives all of it from runtime.Caller, so labels can never drift from the code; the manual http/wrapper emitters and forwarded wrapper.py lines (file= wrapper.py, no package) carry the same fields. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -243,7 +243,7 @@ func must(err error) {
|
||||
// fatal logs through the application JSON logger and exits -- the
|
||||
// structured replacement for log.Fatal.
|
||||
func fatal(msg string, err error) {
|
||||
applog.App("main", "fatal").Error(msg, "error", err)
|
||||
applog.App().Error(msg, "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ func mustFindKindID(ctx context.Context, db *store.DB, userID int64, name string
|
||||
return k.ID
|
||||
}
|
||||
}
|
||||
applog.App("main", "mustFindKindID").Error("no workout kind with that name for the seeded user (did ProvisionUser seed the taxonomy?)", "kind", name)
|
||||
applog.App().Error("no workout kind with that name for the seeded user (did ProvisionUser seed the taxonomy?)", "kind", name)
|
||||
os.Exit(1)
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user