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:
@@ -93,12 +93,12 @@ func main() {
|
||||
|
||||
outPath := "../docs/DATABASE.md"
|
||||
must(os.WriteFile(outPath, []byte(b.String()), 0644))
|
||||
applog.App("main", "main").Info("wrote schema doc", "path", outPath)
|
||||
applog.App().Info("wrote schema doc", "path", outPath)
|
||||
}
|
||||
|
||||
func must(err error) {
|
||||
if err != nil {
|
||||
applog.App("main", "must").Error("dumpschema failed", "error", err)
|
||||
applog.App().Error("dumpschema failed", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user