prevent aggressive DCE in MWE w/ TinyGo and cull fmt package (#196)

* cull fmt package use and prevent aggressive DCE in MWE example with TinyGo

* add noslog build tag and small reference section to README

* add memci

* fix ci

* whoops, forgot memci.json to gitignore

* whoops x2

* use noslog build tag

* don't go ham on removing fmt useful data

* remove old benchmarking CI
This commit is contained in:
Pat Whittingslow
2026-09-06 17:17:14 -03:00
committed by GitHub
parent d219daa2c4
commit d7f3924489
24 changed files with 306 additions and 220 deletions
+2 -2
View File
@@ -10,14 +10,14 @@ import (
const HeapAllocDebugging = false
func LogEnabled(l *slog.Logger, lvl slog.Level) bool {
return l != nil && l.Handler().Enabled(context.Background(), lvl)
return logEnabled && l != nil && l.Handler().Enabled(context.Background(), lvl)
}
// LogAttrs is a helper function that is used by all package loggers and that
// can be switched out with the `debugheaplog` build tag for a non-allocating
// logger that prints out when heap allocations occur.
func LogAttrs(l *slog.Logger, level slog.Level, msg string, attrs ...slog.Attr) {
if l != nil {
if logEnabled && l != nil {
l.LogAttrs(context.Background(), level, msg, attrs...)
}
}