Skip to content

Commit

Permalink
feat: Set log level of FragmentIfcLoader (#281)
Browse files Browse the repository at this point in the history
Co-authored-by: Raphael Stärk <[email protected]>
  • Loading branch information
cytostatic and Raphael Stärk authored Jan 31, 2024
1 parent 93206b9 commit 8a7be0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fragments/FragmentIfcLoader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export * from "./src/types";

export interface FragmentIfcLoaderConfig {
autoSetWasm: boolean;
logLevel?: WEBIFC.LogLevel;
logLevel: WEBIFC.LogLevel;
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
}

/**
Expand All @@ -45,6 +46,7 @@ export class FragmentIfcLoader
config: Required<FragmentIfcLoaderConfig> = {
autoSetWasm: true,
logLevel: WEBIFC.LogLevel.LOG_LEVEL_ERROR,
customLocateFileHandler: null,
};

readonly onSetup = new Event<FragmentIfcLoader>();
Expand Down Expand Up @@ -215,7 +217,7 @@ export class FragmentIfcLoader
async readIfcFile(data: Uint8Array) {
const { path, absolute } = this.settings.wasm;
this._webIfc.SetWasmPath(path, absolute);
await this._webIfc.Init();
await this._webIfc.Init(this.config.customLocateFileHandler ?? undefined);
this._webIfc.SetLogLevel(this.config.logLevel);
return this._webIfc.OpenModel(data, this.settings.webIfc);
}
Expand Down

0 comments on commit 8a7be0a

Please sign in to comment.