Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Commit

Permalink
Updated: Added argument to get current version of JavaLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
Cr4zyFl1x committed Oct 10, 2021
1 parent b75d5d8 commit 9302394
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/eu/cr4zyfl1x/logger/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
*/
public class Logger {

/**
* Logger version string
*/
private static final String version = "1.0.0";

/**
* Loaded logger
*/
Expand Down Expand Up @@ -173,4 +178,12 @@ public static void log(LogType l, String message, boolean logInFile) {
Logger.logger.writeEntryToLogfile(logEntry);
}
}

/**
* Gets the Version of the Logger
* @return Version string
*/
public static String getVersion() {
return version;
}
}
7 changes: 5 additions & 2 deletions src/eu/cr4zyfl1x/logger/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
public class Main {

public static void main(String[] args) {
System.out.println("This is not an executable software!\nYou're trying to execute a Java Library.\n\nMore information:\nhttps://github.com/Cr4zyFl1x/JavaLogger");
JOptionPane.showMessageDialog(null, "This is not an executable software!\nYou're trying to execute a Java Library.\n\nMore information:\nhttps://github.com/Cr4zyFl1x/JavaLogger", "JavaLogger", JOptionPane.INFORMATION_MESSAGE);

if (args.length == 0) {
System.out.println("This is not an executable software!\nYou're trying to execute a Java Library.\n\nLogger version -> java -jar logger.jar version\n\nMore information:\nhttps://github.com/Cr4zyFl1x/JavaLogger");
JOptionPane.showMessageDialog(null, "This is not an executable software!\nYou're trying to execute a Java Library.\n\nMore information:\nhttps://github.com/Cr4zyFl1x/JavaLogger", "JavaLogger", JOptionPane.INFORMATION_MESSAGE);
} else if (args[0].equals("version")) System.out.println(Logger.getVersion());
}
}

0 comments on commit 9302394

Please sign in to comment.