edgeAiLog function

void edgeAiLog(
  1. String message, {
  2. EdgeAiLogLevel level = EdgeAiLogLevel.info,
})

Internal log entry point. Every plugin log routes through here.

  • Release builds: silent regardless of level. kDebugMode is a compile-time false, so the body is dead-code-eliminated. (Callers that interpolate a large/hot variable must still guard the CALL SITE with if (kDebugMode) to avoid building the string in release.)
  • Debug builds: prints when level <= edgeAiLogLevel, after sanitizing U+FFFD so it can't crash flutter run (issue #306).

Implementation

void edgeAiLog(String message, {EdgeAiLogLevel level = EdgeAiLogLevel.info}) {
  if (!kDebugMode) return;
  if (edgeAiLogLevel == EdgeAiLogLevel.none) return;
  if (level.index > edgeAiLogLevel.index) return;
  debugPrint(sanitizeForLog(message));
}