diff --git a/lib/loadObj.js b/lib/loadObj.js index 0003687..937d83f 100644 --- a/lib/loadObj.js +++ b/lib/loadObj.js @@ -481,14 +481,14 @@ function loadMaterials(mtlPaths, objPath, options) { var shallowPath = path.join(objDirectory, path.basename(mtlPath)); if (options.secure && outsideDirectory(mtlPath, objPath)) { // Try looking for the .mtl in the same directory as the obj - optionslogger('The material file is outside of the obj directory and the secure flag is true. Attempting to read the material file from within the obj directory instead.'); + options.logger('The material file is outside of the obj directory and the secure flag is true. Attempting to read the material file from within the obj directory instead.'); return loadMtl(shallowPath) .then(function(materialsInMtl) { Object.assign(materials, materialsInMtl); }) .catch(function(error) { - console.logger(error.message); - console.logger('Could not read material file at ' + shallowPath + '. Using default material instead.'); + options.logger(error.message); + options.logger('Could not read material file at ' + shallowPath + '. Using default material instead.'); }); } return loadMtl(mtlPath)