Tempest last edited by Tempest
Recently on slack I inquired about overriding Console.log to provide enhanced logging functionality, and I was informed that screeps devs have strongly recommended not to enhance the Console object. Can I get someone to confirm this information and provide some details about why the Console object should not be extended. The only thing I planned to do was add a few lines to filter the console output as needed.
SystemParadox last edited by
I've overridden console.log in browsers before and it does work but I did have to fiddle to get it to work properly as for some reason the
thiscontext doesn't work how you would normally expect. Also you can end up with devtools giving you the wrong file/line numbers.
The simplest option would be to make your own global
Logobject and just use that everywhere instead of using
console.logdirectly. I think this is what most people are doing.
Tempest last edited by
@systemparadox Thanks I shall make my own logging object. Simple enough to do.