Adjusted logging locations and levels
This commit is contained in:
		@@ -35,7 +35,7 @@ public class Cache<T> implements Consumer<T>, Serializable {
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	public void accept(T element) {
 | 
			
		||||
		logger.info(String.format("Adding element %s to cache", element));
 | 
			
		||||
		logger.fine(String.format("Adding element %s to cache", element));
 | 
			
		||||
		elements.offer(element);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -77,8 +77,8 @@ public class Client implements Closeable {
 | 
			
		||||
		receiver = new Receiver(socket.getInputStream());
 | 
			
		||||
 | 
			
		||||
		// Register user creation processor, contact list processor and message cache
 | 
			
		||||
		receiver.registerProcessor(User.class, sender -> { logger.info("Acquired user object " + sender); this.sender = sender; });
 | 
			
		||||
		receiver.registerProcessor(Contacts.class, contacts -> { logger.info("Acquired contacts object " + contacts); this.contacts = contacts; });
 | 
			
		||||
		receiver.registerProcessor(User.class, sender -> this.sender = sender);
 | 
			
		||||
		receiver.registerProcessor(Contacts.class, contacts -> this.contacts = contacts);
 | 
			
		||||
		receiver.registerProcessor(Message.class, receivedMessageCache);
 | 
			
		||||
		receiver.registerProcessor(HandshakeRejectionEvent.class, evt -> { rejected = true; EventBus.getInstance().dispatch(evt); });
 | 
			
		||||
 | 
			
		||||
@@ -88,7 +88,6 @@ public class Client implements Closeable {
 | 
			
		||||
		new Thread(receiver).start();
 | 
			
		||||
 | 
			
		||||
		// Write login credentials
 | 
			
		||||
		logger.finest("Sending login credentials...");
 | 
			
		||||
		SerializationUtils.writeBytesWithLength(credentials, socket.getOutputStream());
 | 
			
		||||
 | 
			
		||||
		// Wait for a maximum of five seconds to acquire the sender object
 | 
			
		||||
@@ -225,6 +224,7 @@ public class Client implements Closeable {
 | 
			
		||||
 | 
			
		||||
	private void writeObject(Object obj) throws IOException {
 | 
			
		||||
		checkOnline();
 | 
			
		||||
		logger.fine("Sending object " + obj);
 | 
			
		||||
		SerializationUtils.writeBytesWithLength(obj, socket.getOutputStream());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@ public class MessageStatusChangeEventProcessor implements Consumer<MessageStatus
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	public void accept(MessageStatusChangeEvent evt) {
 | 
			
		||||
		if (evt.get().ordinal() < MessageStatus.RECEIVED.ordinal()) logger.info("Received invalid message status change " + evt);
 | 
			
		||||
		if (evt.get().ordinal() < MessageStatus.RECEIVED.ordinal()) logger.warning("Received invalid message status change " + evt);
 | 
			
		||||
		else EventBus.getInstance().dispatch(evt);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,7 @@ public class Receiver implements Runnable {
 | 
			
		||||
					@SuppressWarnings("rawtypes")
 | 
			
		||||
					Consumer processor = processors.get(obj.getClass());
 | 
			
		||||
					if (processor == null)
 | 
			
		||||
						logger.severe(String.format("The received object has the class %s for which no processor is defined.", obj.getClass()));
 | 
			
		||||
						logger.warning(String.format("The received object has the class %s for which no processor is defined.", obj.getClass()));
 | 
			
		||||
					else processor.accept(obj);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -45,14 +45,14 @@ public class WriteProxy {
 | 
			
		||||
		// Initialize cache processors for messages and message status change events
 | 
			
		||||
		localDb.getMessageCache().setProcessor(msg -> {
 | 
			
		||||
			try {
 | 
			
		||||
				logger.info("Sending cached " + msg);
 | 
			
		||||
				logger.finer("Sending cached " + msg);
 | 
			
		||||
				client.sendMessage(msg);
 | 
			
		||||
			} catch (IOException e) {
 | 
			
		||||
				logger.log(Level.SEVERE, "Could not send cached message", e);
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
		localDb.getStatusCache().setProcessor(evt -> {
 | 
			
		||||
			logger.info("Sending cached " + evt);
 | 
			
		||||
			logger.finer("Sending cached " + evt);
 | 
			
		||||
			try {
 | 
			
		||||
				client.sendEvent(evt);
 | 
			
		||||
			} catch (IOException e) {
 | 
			
		||||
 
 | 
			
		||||
@@ -390,7 +390,6 @@ public class ChatWindow extends JFrame {
 | 
			
		||||
		EventBus.getInstance().register(ContactSearchResult.class, evt -> {
 | 
			
		||||
			contactsModel.clear();
 | 
			
		||||
			final java.util.List<User> contacts = evt.get();
 | 
			
		||||
			logger.info("Received contact search result " + contacts);
 | 
			
		||||
			contacts.forEach(contactsModel::add);
 | 
			
		||||
			revalidate();
 | 
			
		||||
			repaint();
 | 
			
		||||
 
 | 
			
		||||
@@ -89,5 +89,5 @@ public class GeneralSettingsPanel extends SettingsPanel {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public ActionListener getOkButtonAction() { return (evt) -> {}; }
 | 
			
		||||
	public ActionListener getOkButtonAction() { return evt -> {}; }
 | 
			
		||||
}
 | 
			
		||||
@@ -84,7 +84,6 @@ public class EnvoyLog {
 | 
			
		||||
	 * @since Envoy v0.2-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public static Logger getLogger(Class<?> logClass) {
 | 
			
		||||
		// Get a logger with the specified class name
 | 
			
		||||
		return Logger.getLogger(logClass.getCanonicalName());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user