init static method

void init({
  1. int logLevel = RacLogLevel.info,
})

Initialize the RAC commons library.

This must be called before using any RAC functionality. The platform adapter provides callbacks for platform-specific operations.

Throws RacException if initialization fails.

Implementation

static void init({int logLevel = RacLogLevel.info}) {
  if (_initialized) {
    return; // Already initialized
  }

  _lib = PlatformLoader.loadCommons();
  _bindCoreFunctions();

  // For now, pass null config (platform adapter setup done separately)
  // The C++ library handles null config gracefully
  final result = _racInit!(nullptr);

  if (result != RAC_SUCCESS) {
    throw RacException('RAC initialization failed', code: result);
  }

  _initialized = true;
}