Skip to content

Commit

Permalink
Add logger to the loadScript method
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLimeGlass committed Oct 31, 2023
1 parent 78c5337 commit ed3c46d
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,28 @@
* Contains the logic for loading, parsing and interpreting entire script files
*/
public class ScriptLoader {

private static final MultiMap<String, Trigger> triggerMap = new MultiMap<>();

/**
* Parses and loads the provided script in memory
* @param scriptPath the script file to load
* @param debug whether debug is enabled
* Parses and loads the provided script in memory.
*
* @param scriptPath the script file to load.
* @param debug whether debug is enabled.
*/
public static List<LogEntry> loadScript(Path scriptPath, boolean debug) {
var logger = new SkriptLogger(debug);
return loadScript(scriptPath, new SkriptLogger(debug), debug);
}

/**
* Parses and loads the provided script in memory.
* The provided SkriptLogger can be used within syntaxes to input erroring into the logs during parse time.
*
* @param scriptPath the script file to load.
* @param logger The {@link SkriptLogger} to use for the logged entries. Useful for custom logging.
* @param debug whether debug is enabled.
*/
public static List<LogEntry> loadScript(Path scriptPath, SkriptLogger logger, boolean debug) {
List<FileElement> elements;
String scriptName;
try {
Expand Down

0 comments on commit ed3c46d

Please sign in to comment.