Majic-Jungle / sapiens-mod-creation

Official tools and examples for mod creation in the game Sapiens
MIT License
54 stars 12 forks source link

Add a logger to C mods #19

Closed suppergerrie2 closed 1 year ago

suppergerrie2 commented 1 year ago

Currently logging in c mods requires some hacks to write to a custom file, printf (and family) does not seem to print to any of the log files nor the console when opening sapiens with the console.

mjdave commented 1 year ago

There is a now new spLog() function added in 0.3.6 that will allow you to log in the same way that logging works elsewhere. This means that log messages using spLog will both print to the console, and to the per-thread log files in AppData/Roaming/majicjungle/sapiens. You will need to #include SPLog.h in the mod files to use it.

I don't know why exactly printf doesn't currently log to the console as well, but this seemed the best solution.