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,27 @@
package mage.server.services.impl;
import mage.db.EntityManager;
import mage.server.services.LogService;
import org.apache.log4j.Logger;
import java.util.Calendar;
/**
* @author noxx
*/
public enum LogServiceImpl implements LogService {
instance;
private static Logger log = Logger.getLogger(LogServiceImpl.class);
@Override
public void log(String key, String... args) {
Calendar cal = Calendar.getInstance();
try {
EntityManager.instance.insertLog(key, cal.getTime(), args);
} catch (Exception e) {
log.fatal(e);
}
}
}