Skip to content

Commit 9ed6562

Browse files
committed
Merge pull request mrdoob#6287 from JanWaller/dev
Use unified Log,Warn & Error handlers, rather than directly using console.error/warn/log
2 parents 2660853 + 90dd7cc commit 9ed6562

60 files changed

Lines changed: 235 additions & 235 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/js/AudioObject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ THREE.AudioObject = function ( url, volume, playbackRate, loop ) {
4242

4343
} catch ( error ) {
4444

45-
console.warn( "THREE.AudioObject: webkitAudioContext not found" );
45+
THREE.warn( "THREE.AudioObject: webkitAudioContext not found" );
4646
return this;
4747

4848
}

examples/js/MarchingCubes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ THREE.MarchingCubes = function ( resolution, material, enableUvs, enableColors )
740740

741741
this.render( geo_callback );
742742

743-
// console.log( "generated " + geo.faces.length + " triangles" );
743+
// THREE.log( "generated " + geo.faces.length + " triangles" );
744744

745745
return geo;
746746

@@ -751,7 +751,7 @@ THREE.MarchingCubes = function ( resolution, material, enableUvs, enableColors )
751751
};
752752

753753
THREE.MarchingCubes.prototype = Object.create( THREE.ImmediateRenderObject.prototype );
754-
THREE.MarchingCubes.prototype.constructor = THREE.MarchingCubes;
754+
THREE.MarchingCubes.prototype.constructor = THREE.MarchingCubes;
755755

756756

757757
/////////////////////////////////////

examples/js/Mirror.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ THREE.Mirror = function ( renderer, camera, options ) {
103103
} else {
104104

105105
this.camera = new THREE.PerspectiveCamera();
106-
console.log( this.name + ': camera is not a Perspective Camera!' );
106+
THREE.log( this.name + ': camera is not a Perspective Camera!' );
107107

108108
}
109109

examples/js/Octree.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,9 +2029,9 @@
20292029

20302030
space = typeof space === 'string' ? space : spaceAddition;
20312031

2032-
console.log( ( this.parent ? space + ' octree NODE > ' : ' octree ROOT > ' ), this, ' // id: ', this.id, ' // indexOctant: ', this.indexOctant, ' // position: ', this.position.x, this.position.y, this.position.z, ' // radius: ', this.radius, ' // depth: ', this.depth );
2033-
console.log( ( this.parent ? space + ' ' : ' ' ), '+ objects ( ', this.objects.length, ' ) ', this.objects );
2034-
console.log( ( this.parent ? space + ' ' : ' ' ), '+ children ( ', this.nodesIndices.length, ' )', this.nodesIndices, this.nodesByIndex );
2032+
THREE.log( ( this.parent ? space + ' octree NODE > ' : ' octree ROOT > ' ), this, ' // id: ', this.id, ' // indexOctant: ', this.indexOctant, ' // position: ', this.position.x, this.position.y, this.position.z, ' // radius: ', this.radius, ' // depth: ', this.depth );
2033+
THREE.log( ( this.parent ? space + ' ' : ' ' ), '+ objects ( ', this.objects.length, ' ) ', this.objects );
2034+
THREE.log( ( this.parent ? space + ' ' : ' ' ), '+ children ( ', this.nodesIndices.length, ' )', this.nodesIndices, this.nodesByIndex );
20352035

20362036
for ( i = 0, l = this.nodesIndices.length; i < l; i ++ ) {
20372037

examples/js/UCSCharacter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ THREE.UCSCharacter = function() {
3636

3737
// CHARACTER
3838
var loader = new THREE.JSONLoader();
39-
console.log( config.baseUrl + config.character );
39+
THREE.log( config.baseUrl + config.character );
4040
loader.load( config.baseUrl + config.character, function( geometry ) {
4141
geometry.computeBoundingBox();
4242
geometry.computeVertexNormals();

examples/js/WaterShader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ THREE.Water = function ( renderer, camera, scene, options ) {
142142
else
143143
{
144144
this.camera = new THREE.PerspectiveCamera();
145-
console.log(this.name + ': camera is not a Perspective Camera!')
145+
THREE.log(this.name + ': camera is not a Perspective Camera!')
146146
}
147147

148148
this.textureMatrix = new THREE.Matrix4();

examples/js/controls/FlyControls.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ THREE.FlyControls = function ( object, domElement ) {
210210
this.moveVector.y = ( -this.moveState.down + this.moveState.up );
211211
this.moveVector.z = ( -forward + this.moveState.back );
212212

213-
//console.log( 'move:', [ this.moveVector.x, this.moveVector.y, this.moveVector.z ] );
213+
//THREE.log( 'move:', [ this.moveVector.x, this.moveVector.y, this.moveVector.z ] );
214214

215215
};
216216

@@ -220,7 +220,7 @@ THREE.FlyControls = function ( object, domElement ) {
220220
this.rotationVector.y = ( -this.moveState.yawRight + this.moveState.yawLeft );
221221
this.rotationVector.z = ( -this.moveState.rollRight + this.moveState.rollLeft );
222222

223-
//console.log( 'rotate:', [ this.rotationVector.x, this.rotationVector.y, this.rotationVector.z ] );
223+
//THREE.log( 'rotate:', [ this.rotationVector.x, this.rotationVector.y, this.rotationVector.z ] );
224224

225225
};
226226

examples/js/controls/OrbitControls.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ THREE.OrbitControls = function ( object, domElement ) {
208208
} else {
209209

210210
// camera neither orthographic or perspective
211-
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );
211+
THREE.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );
212212

213213
}
214214

@@ -234,7 +234,7 @@ THREE.OrbitControls = function ( object, domElement ) {
234234

235235
} else {
236236

237-
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
237+
THREE.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
238238

239239
}
240240

@@ -260,7 +260,7 @@ THREE.OrbitControls = function ( object, domElement ) {
260260

261261
} else {
262262

263-
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
263+
THREE.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
264264

265265
}
266266

examples/js/effects/StereoEffect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ THREE.StereoEffect = function ( renderer ) {
2222
return scope.eyeSeparation;
2323
},
2424
set: function ( value ) {
25-
console.warn( 'THREE.StereoEffect: .separation is now .eyeSeparation.' );
25+
THREE.warn( 'THREE.StereoEffect: .separation is now .eyeSeparation.' );
2626
scope.eyeSeparation = value;
2727
}
2828
},
@@ -31,7 +31,7 @@ THREE.StereoEffect = function ( renderer ) {
3131
return scope.focalLength;
3232
},
3333
set: function ( value ) {
34-
console.warn( 'THREE.StereoEffect: .targetDistance is now .focalLength.' );
34+
THREE.warn( 'THREE.StereoEffect: .targetDistance is now .focalLength.' );
3535
scope.focalLength = value;
3636
}
3737
}

examples/js/loaders/AWDLoader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ THREE.AWDLoader = (function () {
137137

138138
} else {
139139

140-
console.error( 'AWDLoader: Couldn\'t load ' + url + ' (' + xhr.status + ')' );
140+
THREE.error( 'AWDLoader: Couldn\'t load ' + url + ' (' + xhr.status + ')' );
141141

142142
}
143143

@@ -159,11 +159,11 @@ THREE.AWDLoader = (function () {
159159
this._parseHeader( );
160160

161161
if ( this._compression != 0 ) {
162-
console.error( 'compressed AWD not supported' );
162+
THREE.error( 'compressed AWD not supported' );
163163
}
164164

165165
if (!this._streaming && this._bodylen != data.byteLength - this._ptr ) {
166-
console.error('AWDLoader: body len does not match file length', this._bodylen, blen - this._ptr);
166+
THREE.error('AWDLoader: body len does not match file length', this._bodylen, blen - this._ptr);
167167
}
168168

169169
while ( this._ptr < blen ) {
@@ -451,7 +451,7 @@ THREE.AWDLoader = (function () {
451451
if (type === 0) {
452452
data_len = this.readU32();
453453
var url = this.readUTFBytes(data_len);
454-
console.log( url );
454+
THREE.log( url );
455455

456456
asset = this.loadTexture( url );
457457
} else {
@@ -883,7 +883,7 @@ THREE.AWDLoader = (function () {
883883
var mesh = this.getBlock( geoAdress );
884884

885885
if (mesh == null) {
886-
console.log( "parseMeshPoseAnimation target mesh not found at:", geoAdress );
886+
THREE.log( "parseMeshPoseAnimation target mesh not found at:", geoAdress );
887887
return;
888888
}
889889

0 commit comments

Comments
 (0)