MsLoggy Logging System
This is a custom system for PMMO that allows for granular control over what logged by the mod. If you are not familiar, information such as statuses and errors are only printed to the game's logs if a mod does so. Most mods do this indiscriminately or rely on logging levels defined when you launch the game. MsLoggy takes this one step further and adds deeper control.
Logging Levels
Universal to all logging platforms are the five (5) main logging levels.
Logging Level | General Purpose |
---|---|
INFO | General information such as loading statuses and progress |
DEBUG | Technical information used in solving issues |
WARN | Problematic issues that may or may not need attention |
ERROR | Incorrect behavior that may be causing problems |
FATAL | Incorrect behavior catastrophic to program function |
Project MMO uses these but adds an extra layer on top to let you filter what is shown by each of these levels. By default all levels are enabled and will show all log information that is logged through them.
Logging Categories
MsLoggy adds in logging categories which filter what each logging level shows according to what you want to see.
Log Code | General Purpose |
---|---|
"api" | Logs actions related to API usage, such as registrations |
"autovalues" | Logs information about AutoValues functionality |
"chunk" | Logs data related to chunk storage, such as placed block records |
"data" | Logs information related to datapacks and configurations and the underlying processing of that information |
"event" | Logs event information |
"feature" | Logs information related to features like vein mining, mob scaling, etc |
"gui" | Logs gui-related information |
"loading" | Logs information related to the loading of pmmo |
"network" | Logs information related to packet flow |
"xp" | Logs information related to the gain and manipulation of xp |
"none" | A placeholder for logging levels when you want nothing logged for that level |
Using Categories
MsLoggy is configured in pmmo-common.toml
. Each Logging Level has an array []
which allows you to add categories you want logged. For example if you wanted to log what your datapack configurations look like as well as what Autovalues are being generated, you would use:
INFO = ["data", "autovalues"]
If you were having issues with datapacks you might want more technical information and so adding "data" to the DEBUG list might also be helpful.
INFO = ["data", "autovalues"]DEBUG = ["data"]
The next section will break down every logging aspect and category, so you can see exactly what you are logging when adding categories to these lists.
All Logging Levels, Categories, and Data Points
Level | Category | Log Output |
---|---|---|
INFO | api | - level provider registered - object predicate registered - tooltip supplier is null - tooltip supplier created with item listed |
INFO | autovalues | unused |
INFO | chunk | unused |
INFO | data | - lists all configurations loaded from file with corresponding data - logs when each data loader starts their load - logs isTagFor detection and config cloning |
INFO | event | - damage type and target when dealing damage - break speed event new and old values after perks are applied |
INFO | feature | unused |
INFO | gui | unused |
INFO | loading | - when loading xp data from file - when calculating xp levels from config to cache - when server load process is complete |
INFO | network | - when packets are registered (not practical for general user) |
INFO | xp | - what XP is gained each event proc - Xp gains after bonuses are applied - Xp gains after anti-cheese reductions |
DEBUG | api | - lists perks when registered |
DEBUG | autovalues | - item requirement maps, when generated - item xp maps when generated - tool scaling values, when generated - armor scaling values, when generated |
DEBUG | chunk | - (de)serialized chunk maps when chunks are (un)loaded |
DEBUG | data | - lists all objects and data loaded per loader - lists override configs from CT and API - marks the start of tag processing - xp values when retrieved from data - when the NBT cache is used instead of evaluating the entries |
DEBUG | event | - lists output maps from all mergemap functions - logs when the break speed cache is used - when damage is dealt by the player, logs the damage type, source ID, pre-perk damage, post-perk damage, and final damage type and output damage - when damage is received by the player, log damage type, source ID, and post-perk modified output damage |
DEBUG | feature | - vein target sent to server by client - server-set vein pos and player - players near a mob when spawning used by mob scaling - mob scaling attributes set when mob is spawned - per attribute, mob scaling modifier - players in a party when party is created/checked - vein consumed on vein block break - current vein capacity this half-tick - Vein shape when sent to server - perk ID when executed by an event - if the player is AFK and their duration and cooldown values - random chance value for treasure procs |
DEBUG | gui | - gain list entry duration |
DEBUG | loading | unused |
DEBUG | network | - when another player experience packet is received on the client - packet size when received on the client for data syncs - server receipt for client request of another player XP |
DEBUG | xp | - calculated bonus map - client side skill map after xp update packet - anti-cheese AFK tracker reduction amount - client handled xp update packet with xp values - client received updated level cache - server sent updated skills packet to client |
WARN | api | - invalid event listener was removed |
WARN | autovalues | unused |
WARN | chunk | unused |
WARN | data | unused |
WARN | event | unused |
WARN | feature | unused |
WARN | gui | unused |
WARN | loading | unused |
WARN | network | unused |
WARN | xp | unused |
ERROR | api | - award map could not be deserialized - award map could not be serialized |
ERROR | autovalues | unused |
ERROR | chunk | - chunk data could not be serialized |
ERROR | data | Used by Scripting to identify when parameters or nodes are misused |
ERROR | event | unused |
ERROR | feature | unused |
ERROR | gui | unused |
ERROR | loading | unused |
ERROR | network | unused |
ERROR | xp | unused |
FATAL | ALL | unused |