How can I make the print station not print this sentence? Babylon.js v5.6.0 - WebGL2 - Parallel shader compilation

How can I make the print station not print this sentence? “Babylon.js v5.6.0 - WebGL2 - Parallel shader compilation ”

I don’t think it’s possible via the API - here is the constructor.

You’d need to patch console.log (temporarily for Engine construction) is probably easiest solution.

3 Likes

this solution is great :+1:
I am using React. I found two interception tools ‘npm i patch-console’ and 'npm i console-patch ', but neither of these two tools can effectively intercept logs. Do you know which ones are better toolkit?

You may try to use the simplest solution - redefine console.log function or just make it empty call

console.log = function() {}
1 Like

no need to use a library. make sure you capture what it was before to restore it.
no logging on engine creation | Babylon.js Playground (babylonjs.com)

you can learn more about the process by searching for “Monkey Patching”.

2 Likes

Thank you for the solution, this is a great solution, simple and practical :+1:

this solution is correct :+1: :heartpulse:

That’s a lot of work just to hide the fact that you are using babylon.js.
I am biased, I know, but why would you not want that to display in the console.log? what user is influenced by that in any way?

1 Like

My friend, you misunderstood, I have been recommending babylonjs to many people, and the developers of babylonjs are also very enthusiastic, great, and selfless, they are contributing to human civilization.
The reason it needs to be hidden is that the client made this request when I was developing the project for the client, and in the production environment the print table is required to be clean, that’s all.
I believe that one day babylonjs will become a more popular framework for gaming than unity3D

6 Likes