go-i18n/debug.go
Virgil 852b11fda5
All checks were successful
Security Scan / security (push) Successful in 14s
Test / test (push) Successful in 2m19s
refactor(i18n): align helper formatting with core primitives
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:59:09 +00:00

24 lines
484 B
Go

package i18n
import "dappco.re/go/core"
// SetDebug enables or disables debug mode on the default service.
func SetDebug(enabled bool) {
withDefaultService(func(svc *Service) { svc.SetDebug(enabled) })
}
func (s *Service) SetDebug(enabled bool) {
s.mu.Lock()
defer s.mu.Unlock()
s.debug = enabled
}
func (s *Service) Debug() bool {
s.mu.RLock()
defer s.mu.RUnlock()
return s.debug
}
func debugFormat(key, text string) string {
return core.Sprintf("[%s] %s", key, text)
}