* Logs a warning message with the 'THREE.' prefix. * * If a custom console function is set via setConsoleFunction(), it will be used * instead of the native console.warn. The first parameter is treated as the * method name and is automatically prefixed with 'THREE.'. * * @param {...any} params
( ...params )
| 261 | * the method name and prefixed with 'THREE.'. |
| 262 | */ |
| 263 | function warn( ...params ) { |
| 264 | |
| 265 | params = enhanceLogMessage( params ); |
| 266 | |
| 267 | const message = 'THREE.' + params.shift(); |
| 268 | |
| 269 | if ( _setConsoleFunction ) { |
| 270 | |
| 271 | _setConsoleFunction( 'warn', message, ...params ); |
| 272 | |
| 273 | } else { |
| 274 | |
| 275 | const stackTrace = params[ 0 ]; |
| 276 | |
| 277 | if ( stackTrace && stackTrace.isStackTrace ) { |
| 278 | |
| 279 | console.warn( stackTrace.getError( message ) ); |
| 280 | |
| 281 | } else { |
| 282 | |
| 283 | console.warn( message, ...params ); |
| 284 | |
| 285 | } |
| 286 | |
| 287 | } |
| 288 | |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * Logs an error message with the 'THREE.' prefix. |
no test coverage detected