πLogger
LabAPI provides a custom console printer.
Due to the nature of the game, System.Console won't work. To print your messages inside the server's console, you should use LabAPI's Logger.
Log Types:
There are different methods inside the logger to print messages, each method has a custom color and should be used with a different reason:
Raw - Flexible log level that can be used for any type of log entry. It can be customized with any color or formatting as needed.
Info - Provides general information about the application's operations. These logs are typically used to track the normal functioning of the application and to provide insights into its behavior.
Warn - Indicate a potential issue or unexpected situation that does not currently prevent the application from functioning, but may require attention. These logs are used to flag potential problems that could escalate if not addressed.
Error - Indicate a failure or critical issue that has occurred, which impacts the functionality of the application. These logs are used to record significant problems that need immediate attention.
Debug - Provide detailed diagnostic information for developers. These logs are typically used during development and troubleshooting to understand the application's internal state and behavior, but can also be used in production if the user specifies it, see more in Debugging.
Debugging
Logs are a useful way of showing information inside the console to the end user, but also for debugging.
LabAPI's Logger contains a Debug method, this one accepts a boolean parameter that you can use to easily avoid showing the log in production cases.
public override void Enable()
{
Logger.Debug("This will only be shown in production.", _isInProduction);
}In some cases, it may be useful to integrate a setting like ShowDebug which users can enable to help troubleshooting any issues they may encounter.
Last updated
Was this helpful?