mirror of
https://codeberg.org/Mercury-IM/Mercury-IM
synced 2024-11-14 03:52:04 +01:00
Improve logging
This commit is contained in:
parent
c7a3b59a79
commit
892080fb02
2 changed files with 6 additions and 4 deletions
|
@ -85,7 +85,6 @@ public class LoginViewModel implements MercuryViewModel {
|
|||
}
|
||||
|
||||
public synchronized void onLoginUsernameChanged(String username) {
|
||||
LOGGER.log(Level.INFO, "USERNAME CHANGED: " + username);
|
||||
if (StringUtils.isNullOrEmpty(username)) {
|
||||
loginUsernameValue = null;
|
||||
loginUsernameError.onNext(new Optional<>(UsernameError.emptyUsername));
|
||||
|
|
|
@ -58,7 +58,8 @@ public class MercuryConnection {
|
|||
if (getConnection().isConnected()) {
|
||||
return Completable.complete();
|
||||
}
|
||||
return Completable.fromAction(this::doConnect);
|
||||
return Completable.fromAction(this::doConnect)
|
||||
.doOnError(error -> LOGGER.log(Level.WARNING, "Connection error for account " + account, error));
|
||||
}
|
||||
|
||||
private void doConnect() throws ServerUnreachableException {
|
||||
|
@ -78,7 +79,8 @@ public class MercuryConnection {
|
|||
if (getConnection().isAuthenticated()) {
|
||||
return Completable.complete();
|
||||
}
|
||||
return Completable.fromAction(this::doLogin);
|
||||
return Completable.fromAction(this::doLogin)
|
||||
.doOnError(error -> LOGGER.log(Level.WARNING, "Login error for account " + account, error));
|
||||
}
|
||||
|
||||
private void doLogin() throws InvalidCredentialsException {
|
||||
|
@ -92,7 +94,8 @@ public class MercuryConnection {
|
|||
}
|
||||
|
||||
public Completable shutdown() {
|
||||
return Completable.fromAction(this::doShutdown);
|
||||
return Completable.fromAction(this::doShutdown)
|
||||
.doOnError(error -> LOGGER.log(Level.WARNING, "Shutdown error for account " + account, error));
|
||||
}
|
||||
|
||||
public void doShutdown() {
|
||||
|
|
Loading…
Reference in a new issue