forked from External/mage
LogService. Added saving game started event to DB. Some refactoring.
This commit is contained in:
parent
bdb2754847
commit
b0a1c07067
8 changed files with 249 additions and 7 deletions
33
Mage.Common/src/mage/db/EntityManagerTest.java
Normal file
33
Mage.Common/src/mage/db/EntityManagerTest.java
Normal 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(" --------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue