mirror of
https://github.com/correl/mage.git
synced 2025-01-13 11:01:58 +00:00
remove duplicate logger in UserManager
This commit is contained in:
parent
921f1ff196
commit
39fc9fbc59
1 changed files with 6 additions and 7 deletions
|
@ -29,7 +29,6 @@ public enum UserManager {
|
||||||
|
|
||||||
private List<UserView> userInfoList = new ArrayList<>();
|
private List<UserView> userInfoList = new ArrayList<>();
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(UserManager.class);
|
|
||||||
|
|
||||||
private final ReadWriteLock lock = new ReentrantReadWriteLock();
|
private final ReadWriteLock lock = new ReentrantReadWriteLock();
|
||||||
private final ConcurrentHashMap<UUID, User> users = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<UUID, User> users = new ConcurrentHashMap<>();
|
||||||
|
@ -59,7 +58,7 @@ public enum UserManager {
|
||||||
|
|
||||||
public Optional<User> getUser(UUID userId) {
|
public Optional<User> getUser(UUID userId) {
|
||||||
if (!users.containsKey(userId)) {
|
if (!users.containsKey(userId)) {
|
||||||
LOGGER.trace(String.format("User with id %s could not be found", userId));
|
logger.warn(String.format("User with id %s could not be found", userId));;
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
} else {
|
} else {
|
||||||
return Optional.of(users.get(userId));
|
return Optional.of(users.get(userId));
|
||||||
|
@ -130,10 +129,10 @@ public enum UserManager {
|
||||||
-> USER_EXECUTOR.execute(
|
-> USER_EXECUTOR.execute(
|
||||||
() -> {
|
() -> {
|
||||||
try {
|
try {
|
||||||
LOGGER.info("USER REMOVE - " + user.getName() + " (" + reason.toString() + ") userId: " + userId + " [" + user.getGameInfo() + ']');
|
logger.info("USER REMOVE - " + user.getName() + " (" + reason.toString() + ") userId: " + userId + " [" + user.getGameInfo() + ']');
|
||||||
user.removeUserFromAllTables(reason);
|
user.removeUserFromAllTables(reason);
|
||||||
ChatManager.instance.removeUser(user.getId(), reason);
|
ChatManager.instance.removeUser(user.getId(), reason);
|
||||||
LOGGER.debug("USER REMOVE END - " + user.getName());
|
logger.debug("USER REMOVE END - " + user.getName());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
handleException(ex);
|
handleException(ex);
|
||||||
}
|
}
|
||||||
|
@ -248,12 +247,12 @@ public enum UserManager {
|
||||||
|
|
||||||
public void handleException(Exception ex) {
|
public void handleException(Exception ex) {
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
LOGGER.fatal("User manager exception ", ex);
|
logger.fatal("User manager exception ", ex);
|
||||||
if (ex.getStackTrace() != null) {
|
if (ex.getStackTrace() != null) {
|
||||||
LOGGER.fatal(ex.getStackTrace());
|
logger.fatal(ex.getStackTrace());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGGER.fatal("User manager exception - null");
|
logger.fatal("User manager exception - null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue