From 8e7e9b1278ee431051b6fd608fb86165cb4387d5 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 28 May 2008 22:22:58 +0000 Subject: [PATCH] Work with both for now until I migrate Yohoho. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5140 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/client/LoggingListener.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/presents/client/LoggingListener.java b/src/java/com/threerings/presents/client/LoggingListener.java index ee2acd837..330903c5c 100644 --- a/src/java/com/threerings/presents/client/LoggingListener.java +++ b/src/java/com/threerings/presents/client/LoggingListener.java @@ -21,6 +21,7 @@ package com.threerings.presents.client; +import com.samskivert.util.Log; import com.samskivert.util.Logger; /** @@ -33,18 +34,33 @@ public class LoggingListener * Constructs a listener that will report the supplied error message along with the reason for * failure to the supplied log object. */ - public LoggingListener (Logger log, String errmsg) + public LoggingListener (Log log, String errmsg) { _log = log; _errmsg = errmsg; } + /** + * Constructs a listener that will report the supplied error message along with the reason for + * failure to the supplied log object. + */ + public LoggingListener (Logger log, String errmsg) + { + _logger = log; + _errmsg = errmsg; + } + // documentation inherited from interface public void requestFailed (String reason) { - _log.warning(_errmsg + " [reason=" + reason + "]."); + if (_logger != null) { + _logger.warning(_errmsg + " [reason=" + reason + "]."); + } else { + _log.warning(_errmsg + " [reason=" + reason + "]."); + } } - protected Logger _log; + protected Log _log; + protected Logger _logger; protected String _errmsg; }