* Log a debug information message. * It starts with the current time + " -> LOG_DEBUG: " * Only works in debug mode. * Params: * message = the debug information message * obj = current class reference, mostly you pass 'this'
*
* Log an error message. * The type of the error is fatal so the program will exit with a status code of 1. * It starts with the current time + " -> LOG_ERROR: " * Params: * message = the error message * obj = current class reference, mostly you pass 'this'
* Log an exception message. * It starts with the current time + " -> LOG_EXCEPTION: " * Params: * message = the exception message
* Log an information message. * It starts with the current time + " -> LOG_INFO: " * Params: * message = the information message * obj = current class reference, mostly you pass 'this'
*
* Log a message using LogType.
* Log a todo message. * It starts with the current time + " -> LOG_TODO: " * Params: * message = the todo message * obj = current class reference, mostly you pass 'this'
* Log a warning message. * It starts with the current time + " -> LOG_WARNING: " * Params: * message = the warning message * obj = current class reference, mostly you pass 'this'
* Set false if you don't want logger to run.
* Log file name.
* Example for Logger usage:
class LogClass { this() { Logger.initialize(); scope(exit) Logger.deinitialize(); Logger.console("Test message!", typeof(this).stringof); Logger.info("Info test message!", typeof(this).stringof); Logger.warning("Warning test message!", typeof(this).stringof); Logger.error("Error test message!", typeof(this).stringof); try { immutable int x = 5; if (x == 5) throw new Exception("x cannot be 5!"); } catch (Exception e) { Logger.exception("Exception test message!"); } Logger.todo("Todo test message!", typeof(this).stringof); } } new LogClass();
* Logger class is used for logging a message. * You can log a message to the system console or to a file: "logs.txt". * You can change the log file name. * You can activate or deactivate logger any time.