BabylonJS/Babylon.js — pull request #196 by MaxenceBrasselet (2014-05-13 14:01:39+00:00)
Title: Tools.log update

Hi David,

I was working on Tools.Log when i saw your commit. So I merged your code with mine, now you just have to choose if my upgrade could be useful.

I noticed that you were testing if the log level is the good one in each Log type (Log, Warn and Error methods).

And in my version, I decided to avoid this test on each call, so I made two different callbacks for each log type.

I decided to use flag to set the log level, so if you want to enable Log and Error log levels, you just need to do: BABYLON.Tools.LogLevels = BABYLON.Tools.MessageLogLevel | BABYLON.Tools.ErrorLogLevel;

Thus you have disabled the Warn print.

I made some shortcut:
- BABYLON.Tools.NoneLogLevel (use to disable all log levels).
- BABYLON.Tools.AllLogLevel (use to enable all log levels).

I used property in order to avoir user modification of the different log levels. we can only get them.

If you have any question, mail me.