judos / beltSorter

A factorio mod which provides a sorting chest that can distribute items really fast
5 stars 15 forks source link

Belt Sorter collides with built-in Factorio `log` function in global namespace #14

Closed Afforess closed 8 years ago

Afforess commented 8 years ago

@judos It seems your logging library, loaded at data-load-time in Factorio, is replacing the built-in global log function, which prints to the factorio-current.log file. The offending code seems to be this line: https://github.com/judos/beltSorter/blob/master/source/libs/logging.lua#L1

It breaks a number of mods, such as Bob's mods and Marathon, and countless others.

I see no other solution here but to tell you not to assign log as a function/variable in data-load-time. The lua runtime while Factorio is loading is shared, and this is causing belt sorter to conflict with many other mods. You need to pick a different variable name.

judos commented 8 years ago

Ups, now that's unfortunate. Thanks for the hint. I will correct it asap.

coderatchet commented 8 years ago

The problem is a reassignment of the global log variable in the first line of logging.lua . use a local variable or name the log something else.

paulvandenburg commented 8 years ago

Added a pull request that should fix this, but here is a hot fix to get you going in the mean time: https://github.com/Lappro/beltSorter/raw/master/release/beltSorter_0.3.2.zip

judos commented 8 years ago

Closed already with the pull request @Lappro, thanks for contributing!