Changed to slf4j logging framework

Enhanced error handling/logging in RTL2832 eeprom device descriptor read method for troubleshooting issue present in some R820T tuners.
This commit is contained in:
dennis.sheirer
2014-09-20 10:04:04 +00:00
parent f2f658c43a
commit e441ebf0c9
78 changed files with 791 additions and 834 deletions

View File

@@ -22,8 +22,6 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.geom.Point2D;
import log.Log;
import org.jdesktop.swingx.JXMapViewer;
/**

View File

@@ -17,6 +17,8 @@
******************************************************************************/
package org.jdesktop.swingx.mapviewer;
import gui.SDRTrunk;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -38,9 +40,9 @@ import java.util.concurrent.ThreadFactory;
import javax.imageio.ImageIO;
import javax.swing.SwingUtilities;
import log.Log;
import org.jdesktop.swingx.mapviewer.util.GeoUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The <code>AbstractTileFactory</code> provides
@@ -48,6 +50,9 @@ import org.jdesktop.swingx.mapviewer.util.GeoUtil;
*/
public abstract class AbstractTileFactory extends TileFactory
{
private final static Logger mLog =
LoggerFactory.getLogger( AbstractTileFactory.class );
/**
* Creates a new instance of DefaultTileFactory using the spcified TileFactoryInfo
* @param info a TileFactoryInfo to configure this TileFactory
@@ -345,7 +350,6 @@ public abstract class AbstractTileFactory extends TileFactory
if (img == null)
{
System.out.println("error loading: " + uri);
Log.info("Failed to load: " + uri);
trys--;
}
else
@@ -371,11 +375,13 @@ public abstract class AbstractTileFactory extends TileFactory
{
if (trys == 0)
{
Log.error("Failed to load a tile at url: " + tile.getURL() + ", stopping - " + e.getLocalizedMessage() );
mLog.error("Failed to load a tile at url: " +
tile.getURL() + ", stopping", e );
}
else
{
Log.warning("Failed to load a tile at url: " + tile.getURL() + ", retrying - " + e.getLocalizedMessage() );
mLog.error("Failed to load a tile at url: " +
tile.getURL() + ", retrying", e );
trys--;
}
}

View File

@@ -9,15 +9,17 @@
package org.jdesktop.swingx.mapviewer;
import gui.SDRTrunk;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import log.Log;
import org.jdesktop.swingx.JXMapViewer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This is a standard waypoint renderer.
@@ -25,6 +27,9 @@ import org.jdesktop.swingx.JXMapViewer;
*/
public class DefaultWaypointRenderer implements WaypointRenderer<Waypoint>
{
private final static Logger mLog =
LoggerFactory.getLogger( DefaultWaypointRenderer.class );
private BufferedImage img = null;
/**
@@ -38,7 +43,7 @@ public class DefaultWaypointRenderer implements WaypointRenderer<Waypoint>
}
catch (Exception ex)
{
Log.warning("couldn't read standard_waypoint.png - " + ex.getLocalizedMessage() );
mLog.error("couldn't read standard_waypoint.png", ex );
}
}

View File

@@ -34,13 +34,17 @@ import java.net.URLConnection;
import java.util.List;
import java.util.Map;
import log.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author joshy
*/
public class LocalResponseCache extends ResponseCache
{
private final static Logger mLog =
LoggerFactory.getLogger( LocalResponseCache.class );
private final File cacheDir;
private boolean checkForUpdates;
@@ -159,12 +163,12 @@ public class LocalResponseCache extends ResponseCache
}
catch (MalformedURLException ex)
{
Log.error("An exception occurred - " + ex.getLocalizedMessage() );
mLog.error("An exception occurred - ", ex );
return false;
}
catch (IOException ex)
{
Log.error("An exception occurred - " + ex.getLocalizedMessage() );
mLog.error("An exception occurred - ", ex );
return false;
}
if (!(conn instanceof HttpURLConnection))
@@ -260,7 +264,7 @@ public class LocalResponseCache extends ResponseCache
catch (FileNotFoundException ex)
{
// should not happen, since we already checked for existence
Log.error("An exception occurred - " + ex.getLocalizedMessage() );
mLog.error("An exception occurred - ", ex );
}
this.headers = rqstHeaders;
}
@@ -293,7 +297,7 @@ public class LocalResponseCache extends ResponseCache
catch (FileNotFoundException ex)
{
// should not happen if cache dir is valid
Log.error("An exception occurred" + ex.getLocalizedMessage() );
mLog.error("An exception occurred", ex );
}
}