package com.redpois0n.gscrot;

import java.util.Date;

@SuppressWarnings("deprecation")
public class Logger {

	public static void log(Object obj) {
		String time = getTimeString();

		String s = "[" + time + "] [LOG]: " + obj.toString();

		System.out.println(s);
	}

	public static String getTimeString() {
		Date date = new Date(System.currentTimeMillis());

		String hours = (date.getHours() + "").length() == 1 ? "0" + date.getHours() : Integer.toString(date.getHours());
		String minutes = (date.getMinutes() + "").length() == 1 ? "0" + date.getMinutes() : Integer.toString(date.getMinutes());
		String seconds = (date.getSeconds() + "").length() == 1 ? "0" + date.getSeconds() : Integer.toString(date.getSeconds());

		String time = hours + ":" + minutes + ":" + seconds;
		
		return time;
	}
	
	/**
	 * getTimeString() but replaces : with - which is invalid in path names (at least on Windows)
	 * @return
	 */
	public static String getTimeFileString() {
		return getTimeString().replace(":", "-");
	}
}

@@ -45,47 +45,18 @@
 til.
-Date;%0A%0A@SuppressWarnings(%22deprecation%22)
+Calendar;%0A
 %0Apub
@@ -279,59 +279,76 @@
 %7B%0A%09%09
-Date date = new Date(System.currentTimeMillis()
+int HOUR_OF_DAY = Calendar.getInstance().get(Calendar.HOUR_OF_DAY
 );%0A
-%0A
 %09%09St
@@ -361,31 +361,27 @@
 ours = (
-date.getHours()
+HOUR_OF_DAY
  + %22%22).l
@@ -401,31 +401,27 @@
 ? %220%22 + 
-date.getHours()
+HOUR_OF_DAY
  : Integ
@@ -436,23 +436,80 @@
 ing(
-date.getHours()
+HOUR_OF_DAY);%0A%0A%09%09int MINUTE = Calendar.getInstance().get(Calendar.MINUTE
 );%0A%09
@@ -527,33 +527,22 @@
 utes = (
-date.getMinutes()
+MINUTE
  + %22%22).l
@@ -562,33 +562,22 @@
 ? %220%22 + 
-date.getMinutes()
+MINUTE
  : Integ
@@ -592,25 +592,75 @@
 ing(
-date.getMinutes()
+MINUTE);%0A%0A%09%09int SECOND = Calendar.getInstance().get(Calendar.SECOND
 );%0A%09
@@ -678,33 +678,22 @@
 onds = (
-date.getSeconds()
+SECOND
  + %22%22).l
@@ -713,33 +713,22 @@
 ? %220%22 + 
-date.getSeconds()
+SECOND
  : Integ
@@ -743,25 +743,14 @@
 ing(
-date.getSeconds()
+SECOND
 );%0A%0A
@@ -804,18 +804,16 @@
 econds;%0A
-%09%09
 %0A%09%09retur
@@ -823,17 +823,16 @@
 ime;%0A%09%7D%0A
-%09
 %0A%09/**%0A%09 
@@ -905,16 +905,20 @@
 ames (at
+%0A%09 *
  least o
@@ -928,16 +928,21 @@
 indows)%0A
+%09 * %0A
 %09 * @ret

Fix deprecation