enable method

void enable({
  1. NitroLogLevel level = NitroLogLevel.warning,
  2. int slowCallThresholdMs = 16,
})

Enables Nitro logging in one call.

NitroConfig.instance.enable();                          // warning + 16 ms threshold
NitroConfig.instance.enable(NitroLogLevel.verbose);     // full trace
NitroConfig.instance.enable(NitroLogLevel.error);       // errors only, no timing
  • level — log verbosity to activate (defaults to NitroLogLevel.warning).
  • slowCallThresholdMs — emit a warning for any callAsync that exceeds this many milliseconds. Pass 0 to suppress slow-call warnings even when logging is enabled. Defaults to 16 (one frame at 60 fps).

Implementation

void enable({
  NitroLogLevel level = NitroLogLevel.warning,
  int slowCallThresholdMs = 16,
}) {
  logLevel = level;
  slowCallThresholdUs = slowCallThresholdMs * 1000;
  if (level == NitroLogLevel.verbose) debugMode = true;
}