Browse Source

Initial commit

Luca Mayer 1 year ago
parent
commit
4098759c2a
1 changed files with 80 additions and 0 deletions
  1. 80 0
      R.java

+ 80 - 0
R.java

@@ -0,0 +1,80 @@
+
+
+import java.util.GregorianCalendar;
+
+/**
+ * R which stands for RedLog
+ * The RedLog library is supposed to make life easier considering print commands.
+ *
+ * Under MIT License 
+ *
+ * Zeppel 2019
+ *
+ * github.com/zeppelsoftware/RedLog
+ */
+public class R {
+
+    /**
+     * Println
+     * @param text
+     */
+    public static void out(String text) {
+        System.out.println(text);
+    }
+
+    /**
+     * Append
+     *
+     * @param text
+     */
+    public static void app(String text) {
+        System.out.print(text);
+    }
+
+    /**
+     * Log with timestamp
+     * @param text
+     */
+    public static void log(String text) {
+        System.out.println("["+time()+"] -> "+text);
+    }
+
+    /**
+     * Log Error
+     *
+     * @param text
+     */
+    public static void log_err(String text) {
+        System.err.println("["+time()+"] -> "+text);
+    }
+
+    /**
+     * Append Error
+     *
+     * Append in red
+     * @param text
+     */
+    public static void app_err(String text) {
+        System.err.print(text);
+    }
+
+    /**
+     * Append Error
+     *
+     * Append in red
+     * @param text
+     */
+    public static void err(String text) {
+        System.err.println(text);
+    }
+
+    /**
+     * Returns current time
+     * used by log
+     *
+     * @return
+     */
+    public static String time() {
+        return ""+ new GregorianCalendar().getTime();
+    }
+}