Browse Source

[Improved] Usage of printf

master
Paul Glaß 3 years ago
parent
commit
e7fff880a4
1 changed files with 20 additions and 20 deletions
  1. +20
    -20
      app/src/main/java/de/yannicpunktdee/yoshibot/utils/Logger.java

+ 20
- 20
app/src/main/java/de/yannicpunktdee/yoshibot/utils/Logger.java View File

@ -9,35 +9,35 @@ public final class Logger {
public static void logDebug(String message){
System.out.println(String.format("%s[%tT: Yoshi::DEBUG] %s%s",
ANSI_GREEN,
System.currentTimeMillis(),
message,
ANSI_RESET));
System.out.printf("%s[%tT: Yoshi::DEBUG] %s%s%n",
ANSI_GREEN,
System.currentTimeMillis(),
message,
ANSI_RESET);
}
public static void logInfo(String message){
System.out.println(String.format("%s[%tT: Yoshi::INFO] %s%s",
ANSI_BLUE,
System.currentTimeMillis(),
message,
ANSI_RESET));
System.out.printf("%s[%tT: Yoshi::INFO] %s%s%n",
ANSI_BLUE,
System.currentTimeMillis(),
message,
ANSI_RESET);
}
public static void logWarning(String message){
System.out.println(String.format("%s[%tT: Yoshi::WARNING] %s%s",
ANSI_YELLOW,
System.currentTimeMillis(),
message,
ANSI_RESET));
System.out.printf("%s[%tT: Yoshi::WARNING] %s%s%n",
ANSI_YELLOW,
System.currentTimeMillis(),
message,
ANSI_RESET);
}
public static void logError(String message){
System.err.println(String.format("%s[%tT: Yoshi::ERROR] %s%s",
ANSI_YELLOW,
System.currentTimeMillis(),
message,
ANSI_RESET));
System.err.printf("%s[%tT: Yoshi::ERROR] %s%s%n",
ANSI_YELLOW,
System.currentTimeMillis(),
message,
ANSI_RESET);
}
}

Loading…
Cancel
Save