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
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue