Skip to main content

Logging Standards

The LogManager class initialises Deserted Chateau's frontend loggers. To use them, you must use the syntax shown below.

See the LogManager class for a list of available logging objects.

/*
 * The color() functions work as follows:
 * - color(): prints DEBUG in its corresponding color
 * - colorI(): the same, but for INFO
 * - colorW(): the same, but for WARN
 * - colorE(): the same, but for ERROR
 * 
 * This system is used to avoid wrapping log statements in another function,
 * which would screw up the console stacktrace.
*/

// Normal logging statement
dcLogger.debug(color() + "Your log message");

// Logging an object without a string
dcLogger.debug(color(), data);

// Logging a non-debug message: use a different Color function
dcLogger.error(colorE() + "Your log message");

// Logging a gallery-specific message
dcGalleryLogger.debug(color() + "Your gallery-specific log message");