Skip to content

Logging: Track logged messages #140

Closed
@ithinkandicode

Description

@ithinkandicode

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.
  • 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 messages
      • by_mod = Notices logged via a certain mod
      • by_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) -- where type 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.

Metadata

Metadata

Labels

validationFeature to make things safe and predictable

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions