-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Renderers: Use internal log
, warn
and error
functions instead of the system ones
#31790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Sounds good to me 👍 |
Why do we need Can't we just do |
This is the interesting part, with
I didn’t understand the purpose, could you explain it to me? |
Ah, I think I understand. With Sounds good sounds good 👍 |
Description
This PR implements an approach similar to the one used in
warnOnce
, but for native console functions such aslog
,warn
, anderror
.The idea is to gain control over the warnings being issued and thus create more advanced systems for these logs, such as monitoring them through functions. This can be very useful if three.js is used in general-purpose tools like editors and inspectors.
The function to set a callback for console functions is
setConsoleFunction
andgetConsoleFunction
:The
THREE.
prefix is also no longer necessary, as it is automatically added in the intermediate function.