From dca15b39fe385e878fc17c684c3efd77a193bf0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 12 Jun 2008 16:02:31 +0200 Subject: [PATCH] change logging --- src/net/pterodactylus/jsite/core/NodeManager.java | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/net/pterodactylus/jsite/core/NodeManager.java b/src/net/pterodactylus/jsite/core/NodeManager.java index 437dace..922a85a 100644 --- a/src/net/pterodactylus/jsite/core/NodeManager.java +++ b/src/net/pterodactylus/jsite/core/NodeManager.java @@ -125,7 +125,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * The node that was added. */ private void fireNodeAdded(Node node) { - logger.finest("firing nodeAdded event with [node=" + node + "]"); + logger.log(Level.FINEST, "firing nodeAdded event with [node=" + node + "]"); for (NodeListener nodeListener : nodeListeners) { nodeListener.nodeAdded(node); } @@ -138,7 +138,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * The node that was removed */ private void fireNodeRemoved(Node node) { - logger.finest("firing nodeRemoved event with [node=" + node + "]"); + logger.log(Level.FINEST, "firing nodeRemoved event with [node=" + node + "]"); for (NodeListener nodeListener : nodeListeners) { nodeListener.nodeRemoved(node); } @@ -151,7 +151,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * The node that is now connected */ private void fireNodeConnected(Node node) { - logger.finest("firing nodeConnected event with [node=" + node + "]"); + logger.log(Level.FINEST, "firing nodeConnected event with [node=" + node + "]"); for (NodeListener nodeListener : nodeListeners) { nodeListener.nodeConnected(node); } @@ -166,7 +166,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * The cause of the failure */ private void fireNodeConnectionFailed(Node node, Throwable cause) { - logger.finest("firing nodeConnectionFailed event with [node=" + node + ",cause=" + cause + "]"); + logger.log(Level.FINEST, "firing nodeConnectionFailed event with [node=" + node + ",cause=" + cause + "]"); for (NodeListener nodeListener : nodeListeners) { nodeListener.nodeConnectionFailed(node, cause); } @@ -182,7 +182,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * if there was no exception */ private void fireNodeDisconnected(Node node, Throwable throwable) { - logger.finest("firing nodeDisconnected event with [node=" + node + ",throwable=" + throwable + "]"); + logger.log(Level.FINEST, "firing nodeDisconnected event with [node=" + node + ",throwable=" + throwable + "]"); for (NodeListener nodeListener : nodeListeners) { nodeListener.nodeDisconnected(node, throwable); } @@ -231,7 +231,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * if an I/O error occurs loading the nodes */ public void load() throws IOException { - logger.finest("load()"); + logger.log(Level.FINEST, "load()"); File directoryFile = new File(directory); File nodeFile = new File(directoryFile, "nodes.properties"); if (!nodeFile.exists() || !nodeFile.isFile() || !nodeFile.canRead()) { @@ -283,7 +283,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High newNode.setPort(nodePort); loadedNodes.add(newNode); } - logger.fine("loaded " + loadedNodes.size() + " nodes from config"); + logger.log(Level.FINE, "loaded " + loadedNodes.size() + " nodes from config"); synchronized (syncObject) { nodes.clear(); for (Node node : loadedNodes) { @@ -299,7 +299,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * if an I/O error occurs saving the nodes */ public void save() throws IOException { - logger.finest("save()"); + logger.log(Level.FINEST, "save()"); File directoryFile = new File(directory); if (!directoryFile.exists()) { if (!directoryFile.mkdirs()) { @@ -335,9 +335,9 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * if the node was not added because it was already known */ public boolean addNode(Node node) { - logger.finest("addNode(node=" + node + ")"); + logger.log(Level.FINEST, "addNode(node=" + node + ")"); if (nodes.contains(node)) { - logger.warning("was told to add already known node: " + node); + logger.log(Level.WARNING, "was told to add already known node: " + node); return false; } node.addPropertyChangeListener(this); @@ -359,7 +359,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * The node to remove */ public void removeNode(Node node) { - logger.finest("removeNode(node=" + node + ")"); + logger.log(Level.FINEST, "removeNode(node=" + node + ")"); synchronized (syncObject) { if (!nodes.contains(node)) { return; @@ -381,11 +381,11 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * The node to connect to */ public void connect(Node node) { - logger.finest("connect(node=" + node + ")"); + logger.log(Level.FINEST, "connect(node=" + node + ")"); HighLevelClient highLevelClient; highLevelClient = nodeClients.get(node); if (highLevelClient == null) { - logger.warning("was told to connect to unknown node: " + node); + logger.log(Level.WARNING, "was told to connect to unknown node: " + node); return; } try { @@ -404,7 +404,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * The node to disconnect */ public void disconnect(Node node) { - logger.finest("disconnect(node=" + node + ")"); + logger.log(Level.FINEST, "disconnect(node=" + node + ")"); synchronized (syncObject) { if (!nodes.contains(node)) { return; @@ -470,7 +470,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * if there is a problem with the node */ public String[] generateKeyPair() throws IOException, JSiteException { - logger.finest("generateKeyPair()"); + logger.log(Level.FINEST, "generateKeyPair()"); if (nodes.isEmpty()) { throw new NoNodeException("no node configured"); } @@ -499,7 +499,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * {@inheritDoc} */ public void clientConnected(HighLevelClient highLevelClient) { - logger.finest("clientConnected(highLevelClient=" + highLevelClient + ")"); + logger.log(Level.FINEST, "clientConnected(highLevelClient=" + highLevelClient + ")"); Node node = clientNodes.get(highLevelClient); if (node == null) { logger.log(Level.WARNING, "got event for unknown client"); @@ -512,7 +512,7 @@ public class NodeManager implements Iterable, PropertyChangeListener, High * {@inheritDoc} */ public void clientDisconnected(HighLevelClient highLevelClient, Throwable throwable) { - logger.finest("clientDisconnected(highLevelClient=" + highLevelClient + ",throwable=" + throwable + ")"); + logger.log(Level.FINEST, "clientDisconnected(highLevelClient=" + highLevelClient + ",throwable=" + throwable + ")"); synchronized (syncObject) { Node node = clientNodes.get(highLevelClient); if (node == null) { -- 2.7.4