NQualityOfLife.Utils.Log - Niilo007/RimWorld-NQoL GitHub Wiki

Class

Related:

C#

public static class Log
{

}

Usage

The NQualityOfLife.Utils.Log class is used to log errors, warnings and messages in a more human readable and convenient format.

Conventions

All log messages in the NQoL mod start with "NQoL".

Message Type Tags Notes
[E] Error
[W] Warning
[D] Debug message or warning Should never be logged with the global (NQoL) debug setting enabled.
Normal message Should be used only to log the spare minimum information needed. Such as version on startup.

Features

Log Look Targets

NQoL implements look targets for log messages.

This allows for easily finding what or where in the actual map the issue happened.
Clicking the error message will pan the camera to the specified location on the local or world map.

There are currently two types of supported look targets.

Map Targets

Look targets for the local map are formatted as: @{359|310} for @{x|y}

World Targets

Look targets for the world map are formatted as: (tile=298141) for (tile=tile id)

Examples


The below error message contains multiple parts.

NQoL [E] - Tells us that this is an error.

Utils.Rand:SelectRandom Is the type and method where the error occured.

('IList`1 set == System.Collections.Generic.List`1[Verse.IntVec3]', 'int setSize == -1') Shows the methods input parameters and their values at the time the error was logged.

- The set is empty! Is the actual error message.

NQoL [E] - Utils.Rand:SelectRandom('IList`1 set == System.Collections.Generic.List`1[Verse.IntVec3]', 'int setSize == -1') - The set is empty!

The below error messages contain embedded look targets.

NQoL [E] - DwellingFinder:ValidDwellingsForPawn('Pawn == AEXP_Otter7108962', 'UnOrderedList`1 == null', 'Map == Map-2-PlayerHome', 'DwellingType == Invalid') - 'pawn', 'dwellings' or 'map' is 'null'!@{212|20}

NQoL [E] - DwellingFinder:ValidDwellingsForPawn('Pawn == AEXP_WildGoose7110010', 'UnOrderedList`1 == null', 'Map == Map-0-PlayerHome', 'DwellingType == Invalid') - 'pawn', 'dwellings' or 'map' is 'null'!@{204|8}