Description
In #138 I added the array variable logged_messages
. I think this is a potentially very useful approach that could be applied it to all logged messages.
Implementation:
- In
_loader_log
, we save logged messages to an array.- This is the same as what I did for feat: ✨ Config JSON: Only log notice for no custom JSON once #138,
- but with the array variable being in
ModLoaderUtils
instead.
- For each message, we can track all the data parts that are passed as variables to
_loader_log
- Ie. mod name, message, and type.
- Actually, it might be better as a dictionary, with these keys:
all
= All logged messagesby_mod
= Notices logged via a certain modby_type
= Notices of a specific type
API Methods:
get_tracked_messages_all()
get_tracked_messages_by_mod(mod_name: String)
get_tracked_messages_by_type(type: String)
-- wheretype
is one of the current log types (fatal-error
,error
, etc)
Use Case:
This would be a massive help to players who are using mods, as it would save them needing to check the logs (and save them needing to know how to do that). This does depend on the game or a mod presenting this data, but this is the first step towards supporting that.
Note: This isn't related to UI at all. It simply provides data that a UI could interact with, which would be the responsibility of the game developer or modders -- like how Brotato's Mods screen interacts with ModLoader's current data (see example with otDan's mod BetterModList). So on that screen, it could include a console-like tray with any errors or warnings.