A we bit of (not so) new logging world order conversion.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4718 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-05-23 18:40:15 +00:00
parent 17e36673d0
commit 8206753188
@@ -22,17 +22,19 @@
package com.threerings.presents.server; package com.threerings.presents.server;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Level;
import com.samskivert.util.Interval; import com.samskivert.util.Interval;
import com.samskivert.util.ObserverList; import com.samskivert.util.ObserverList;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.samskivert.util.SystemInfo; import com.samskivert.util.SystemInfo;
import com.threerings.presents.Log;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.dobj.AccessController; import com.threerings.presents.dobj.AccessController;
import com.threerings.presents.server.net.ConnectionManager; import com.threerings.presents.server.net.ConnectionManager;
import static com.threerings.presents.Log.log;
/** /**
* The presents server provides a central point of access to the various facilities that make up * The presents server provides a central point of access to the various facilities that make up
* the presents framework. To facilitate extension and customization, a single instance of the * the presents framework. To facilitate extension and customization, a single instance of the
@@ -92,7 +94,7 @@ public class PresentsServer
{ {
// output general system information // output general system information
SystemInfo si = new SystemInfo(); SystemInfo si = new SystemInfo();
Log.info("Starting up server [os=" + si.osToString() + ", jvm=" + si.jvmToString() + log.info("Starting up server [os=" + si.osToString() + ", jvm=" + si.jvmToString() +
", mem=" + si.memoryToString() + "]."); ", mem=" + si.memoryToString() + "].");
// register SIGINT (ctrl-c) and a SIGHUP handlers // register SIGINT (ctrl-c) and a SIGHUP handlers
@@ -242,8 +244,7 @@ public class PresentsServer
try { try {
rptr.appendReport(report, now, sinceLast, reset); rptr.appendReport(report, now, sinceLast, reset);
} catch (Throwable t) { } catch (Throwable t) {
Log.warning("Reporter choked [rptr=" + rptr + "]."); log.log(Level.WARNING, "Reporter choked [rptr=" + rptr + "].", t);
Log.logStackTrace(t);
} }
} }
@@ -277,7 +278,7 @@ public class PresentsServer
*/ */
protected void logReport (String report) protected void logReport (String report)
{ {
Log.info(report); log.info(report);
} }
/** /**
@@ -288,7 +289,7 @@ public class PresentsServer
{ {
ObserverList<Shutdowner> downers = _downers; ObserverList<Shutdowner> downers = _downers;
if (downers == null) { if (downers == null) {
Log.warning("Refusing repeat shutdown request."); log.warning("Refusing repeat shutdown request.");
return; return;
} }
_downers = null; _downers = null;
@@ -343,7 +344,7 @@ public class PresentsServer
public static void main (String[] args) public static void main (String[] args)
{ {
Log.info("Presents server starting..."); log.info("Presents server starting...");
PresentsServer server = new PresentsServer(); PresentsServer server = new PresentsServer();
try { try {
@@ -354,14 +355,12 @@ public class PresentsServer
String testmod = System.getProperty("test_module"); String testmod = System.getProperty("test_module");
if (testmod != null) { if (testmod != null) {
try { try {
Log.info("Invoking test module [mod=" + testmod + "]."); log.info("Invoking test module [mod=" + testmod + "].");
Class tmclass = Class.forName(testmod); Class tmclass = Class.forName(testmod);
Runnable trun = (Runnable)tmclass.newInstance(); Runnable trun = (Runnable)tmclass.newInstance();
trun.run(); trun.run();
} catch (Exception e) { } catch (Exception e) {
Log.warning("Unable to invoke test module " + log.log(Level.WARNING, "Unable to invoke test module '" + testmod + "'.", e);
"[mod=" + testmod + "].");
Log.logStackTrace(e);
} }
} }
@@ -370,8 +369,7 @@ public class PresentsServer
server.run(); server.run();
} catch (Exception e) { } catch (Exception e) {
Log.warning("Unable to initialize server."); log.log(Level.WARNING, "Unable to initialize server.", e);
Log.logStackTrace(e);
System.exit(-1); System.exit(-1);
} }
} }