LogService. Added saving game started event to DB. Some refactoring.

This commit is contained in:
magenoxx 2012-01-25 20:27:08 +04:00
parent bdb2754847
commit b0a1c07067
8 changed files with 249 additions and 7 deletions

View file

@ -0,0 +1,33 @@
package mage.db;
import mage.db.model.Log;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* @author noxx
*/
public class EntityManagerTest {
private static DateFormat timeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.FULL);
public static void main(String[] args) throws Exception {
EntityManager.instance.testDB();
List<Log> logs = EntityManager.instance.getAllLogs();
System.out.println("logs found: " + logs.size());
for (Log log : logs) {
System.out.println(" key=" + log.getKey());
System.out.println(" date=" + timeFormatter.format(log.getCreatedDate()));
System.out.print(" arguments=[ ");
if (log.getArguments() != null) {
for (String argument : log.getArguments()) {
System.out.print("arg=" + argument + " ");
}
}
System.out.println("]");
System.out.println(" --------------");
}
}
}