init method
Implementation
Future<bool> init({ALoggerConfig? loggerConfig}) async {
if (_rootPath != null) {
return true;
}
loggerConfig ??= ALoggerConfig();
var logRootPath = loggerConfig.path;
if (logRootPath?.isEmpty ?? true) {
logRootPath = await _defaultLogRootPath;
}
//此处适配iOS,传入路径后缀无分隔符'/';
_rootPath = logRootPath!.endsWith('/') ? logRootPath : '$logRootPath/';
if (!(await _createDirectory(rootPath))) return false;
if (!(await _createDirectory(_nimSDKPath))) return false;
if (!(await _createDirectory(_rtcSDKPath))) return false;
final success = Alog.init(
loggerConfig.level, _roomSDKPath, loggerConfig.namePrefix ?? 'roomkit');
print('RoomLogService init with path: $rootPath, success: $success');
if (!success) {
_rootPath = null;
}
return success;
}