tesselode / nata

Entity management for Lua.
https://tesselode.github.io/nata/
MIT License
43 stars 2 forks source link

Add a way to listen to all events with Pool:on #1

Open Sasszem opened 4 years ago

Sasszem commented 4 years ago

I think it would be extremely helpful for logging & debugging purposes to add a special event like "all" or "*" or nil to execute function on all events.

tesselode commented 4 years ago

possibly!

out of curiosity, would you be able to figure out how to add the logging directly to the library?

Sasszem commented 4 years ago

I am currently trying to hack something around it via replacing emit with a custom one that also logs certain events (based on an ignore list) & print the ones with moon.p.

I am no expert in logging, but I think adding logging directly to the lib would be a bit too much

I do not know how to implement all those stuff flexible, so I think a way of letting the users tap all events means you can implement whatever way you want to log.

tesselode commented 4 years ago

how's your hacking going?

Sasszem commented 4 years ago

(Had a few hours of sleep before school) I did this last night: https://github.com/Sasszem/crossfire/blob/master/src/EventLogger.moon (Yea, I use moon for my amazing project)