mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-09 04:42:30 -04:00
logToErased asserts that a log message is at most 30 characters of plain text, but only in a debug build and only once the line actually runs. A message on a rare path therefore ships fine and then panics on whoever first reaches it: `serve --host 0.0.0.0` without --advertise-host crashed on startup in every debug build, because "advertising loopback for wildcard bind" is 38 characters. Every message is a literal, so make the six wrappers take a comptime msg and apply the same two rules through @compileError. The runtime check stays as the backstop for the paths the compiler does not analyse for the current target, and now reads the same constant. Eleven messages were over the limit; shorten them. The detail already lives in the kv pairs in each case. renderFailed takes its message as comptime now, the only call site that passed a runtime one. Note the check only covers code analysed for the target being built: the two in Certificates.zig sit in an OS switch prong that Linux never compiles, and were found by scanning the source rather than by the compiler.