Artifact b99ae5f5823e3c83b698ef07d64f627e941c7a3569f2e38a8f61999ed54e4159:
- File
internal/manifest/log_slog.go
— part of check-in
[2abfe81c2a]
at
2026-10-31 13:38:56
on branch spike/wasm-size
— perf(wasm): keep regexp, strings.Replacer and log/slog out of small builds
Spike for a smaller TinyGo engine (html-artifact-publisher). Behaviour on every platform is unchanged:
- repo: table names are checked with a byte loop, not a regexp, so a build that uses no other regexp leaves package regexp out (about 69 KB gzipped in the publisher's engine, with the engine's own two regexps). - fsltype: HTMLize escapes with a byte loop instead of a strings.Replacer (about 15 KB gzipped). - manifest: the package's diagnostics go through logDebug, logInfo and logWarn. By default they call log/slog as before. With the libfossil_noslog build tag they are written to stderr as plain lines and log/slog stays out (about 33 KB gzipped). Tests that assert on slog output need the default build. (user: [email protected], size: 395) [annotate] [blame] [check-ins using] [more...]
//go:build !libfossil_noslog package manifest import "log/slog" // The package's diagnostics go to log/slog's default logger, unless the build // sets libfossil_noslog (see log_noslog.go). func logDebug(msg string, args ...any) { slog.Debug(msg, args...) } func logInfo(msg string, args ...any) { slog.Info(msg, args...) } func logWarn(msg string, args ...any) { slog.Warn(msg, args...) }