shieldLog function
Sanitizes PII from message and logs it with a level and optional tag.
Drop-in replacement for structured logging.
shieldLog('User email: john@test.com');
// Output: [INFO] User email: [EMAIL HIDDEN]
shieldLog('Auth failed', level: 'ERROR', tag: 'auth');
// Output: [ERROR] [auth] Auth failed
Implementation
void shieldLog(String message, {String level = 'INFO', String? tag}) {
LogShield().log(message, level: level, tag: tag);
}