-
Notifications
You must be signed in to change notification settings - Fork 52
Logger
QModManager has a utility built into it to help mods log relevant errors or even just info that you wish to track in the games own log file and optionally onscreen in-game.
You can access this utility through QModManager.Utility.Logger and there is 3 things you can access.
First is an Enum for what Level your logging will be showing when your message:
public enum Level
{
Debug,
Info,
Warn,
Error,
Fatal
}
Second is a bool called DebugLogsEnabled which you can use to check if the player has enabled the debug logs of QMM in the options menu.
The third is the actual Log Method which has the following parameters:
Level: This is from the Enum above and is mandatory.
string: This is your message you want logged but is optional (Default = null)
Exception: this is where you can pass through an exception to be logged and is optional (Default = null)
bool: this bool is used if you want to display the message in-game on screen as well as in the log and is optional (Default = false)
While Message and Exception are both optional if both are left as null then the logger will return without doing anything.
If there is something missing or ambiguous, please create an issue or contact us on the Subnautica Modding Discord using our tags:
- PrimeSonic:
@PrimeSonic#0667
- Metious:
@Metious#3682