浏览代码

Add missing context in glTF loader logging

Gary Hsu 4 年之前
父节点
当前提交
464ef002a6
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      loaders/src/glTF/2.0/glTFLoader.ts

+ 3 - 3
loaders/src/glTF/2.0/glTFLoader.ts

@@ -2073,17 +2073,17 @@ export class GLTFLoader implements IGLTFLoader {
 
         if (Tools.IsBase64(uri)) {
             const data = new Uint8Array(Tools.DecodeBase64(uri));
-            this.log(`Decoded ${uri.substr(0, 64)}... (${data.length} bytes)`);
+            this.log(`${context}: Decoded ${uri.substr(0, 64)}... (${data.length} bytes)`);
             return Promise.resolve(data);
         }
 
-        this.log(`Loading ${uri}`);
+        this.log(`${context}: Loading ${uri}`);
 
         return this._parent.preprocessUrlAsync(this._rootUrl + uri).then((url) => {
             return new Promise((resolve, reject) => {
                 this._parent._loadFile(url, this._babylonScene, (data) => {
                     if (!this._disposed) {
-                        this.log(`Loaded ${uri} (${(data as ArrayBuffer).byteLength} bytes)`);
+                        this.log(`${context}: Loaded ${uri} (${(data as ArrayBuffer).byteLength} bytes)`);
                         resolve(new Uint8Array(data as ArrayBuffer));
                     }
                 }, true, (request) => {