Similar log entry also appears when using the actual Engine, but with NullEngine this is a real bummer. It just introduces useless noise when running the tests. How could I disable this?
I see that inside NullEngineconstructor that it uses Logger:
Perhaps there’s some way to disable the logger? I looked at the documentation of Logger but failed to find a way to disable the logging.
Possibly I could change my test environment to replace the console.log with some dummy function that does nothing. But I’d really leave it as a last resort.
After digging through Logger implementation, I finally discovered a way to disable the logging:
Logger.LogLevels = Logger.NoneLogLevel;
The documentation of LogLevels attribute only says the following:
Sets the current log level (MessageLogLevel / WarningLogLevel / ErrorLogLevel)
This is terribly confusing. Like why is the name plural when the docs say that it sets just a single log level? And it doesn’t say anything about being able to use NoneLogLevel or AllLogLevel with this attribute.
Turns out that these log levels are encoded as a bitmap. And you can set any combination of them (or none at all) by combining the values with bitwise-or: