# Logger Logging utilities for WaspLib scripts. - - - ## ELogLevel ```pascal ELogLevel = enum(SUCCESS, WARN, ERROR); ``` Enum representing log message severity levels. - - - ## TLogger Record for managing script logging to files and console output. - - - ## Logger.Init ```pascal procedure TLogger.Init(); ``` Initializes the logger, creating the log directory and file. Called automatically at script start. - - - ## Logger.Setup ```pascal procedure TLogger.Setup(name: String = ''); ``` Configures the logger with a script name. Creates a dedicated log directory. Example: ```pascal Logger.Setup('MyScript'); ``` - - - ## Logger variable Global {ref}`TLogger` variable. - - - ## GetDebugLn ```pascal function GetDebugLn(text: String; log: Boolean = True): String; function GetDebugLn(name, text: String; log: Boolean = True): String; overload; function GetDebugLn(text: String; level: ELogLevel; log: Boolean = True): String; overload; function GetDebugLn(name, text: String; level: ELogLevel; log: Boolean = True): String; overload; ``` Returns a formatted debug string with timestamp. Optionally logs to file and applies color formatting based on `level`. - - - ## Logger.Info ```pascal procedure TLogger.Info(text: String; vars: TVariantArray = []); ``` Logs an info message. Duplicate consecutive messages are suppressed unless `Logger.RepeatedMessages` is True. - - - ## Logger.Success ```pascal procedure TLogger.Success(text: String; vars: TVariantArray = []); ``` Logs a success message (green colored output). - - - ## Logger.Warn ```pascal procedure TLogger.Warn(text: String; vars: TVariantArray = []); ``` Logs a warning message (yellow colored output). - - - ## Logger.Error ```pascal procedure TLogger.Error(text: String; vars: TVariantArray = []); ``` Logs an error message (red colored output). - - - ## Logger.Exception ```pascal procedure TLogger.Exception(text: String; vars: TVariantArray = []); ``` Logs an error message and raises an exception to halt script execution.