mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
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:
@@ -20,12 +20,13 @@ package controller.activity;
|
||||
import java.awt.EventQueue;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
|
||||
import log.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sample.Broadcaster;
|
||||
import sample.Listener;
|
||||
import controller.activity.CallEvent.CallEventType;
|
||||
@@ -33,6 +34,8 @@ import controller.activity.CallEvent.CallEventType;
|
||||
public class CallEventModel extends AbstractTableModel
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( CallEventModel.class );
|
||||
|
||||
private static DecimalFormat mFrequencyFormatter =
|
||||
new DecimalFormat( "0.000000" );
|
||||
@@ -175,7 +178,7 @@ public class CallEventModel extends AbstractTableModel
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.error( "CallEventModel - couldn't log end time - event was null" );
|
||||
mLog.error( "CallEventModel - couldn't log end time - event was null" );
|
||||
}
|
||||
}
|
||||
} );
|
||||
@@ -210,7 +213,7 @@ public class CallEventModel extends AbstractTableModel
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.error( "CallEventModel - tried to set from ID on "
|
||||
mLog.error( "CallEventModel - tried to set from ID on "
|
||||
+ "call event - couldn't find index of event" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,11 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
import log.Log;
|
||||
import message.Message;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import record.config.RecordConfiguration;
|
||||
import sample.Listener;
|
||||
import source.SourceType;
|
||||
@@ -63,6 +66,8 @@ import eventlog.config.EventLogConfiguration;
|
||||
@XmlRootElement( name = "channel" )
|
||||
public class Channel extends Configuration
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger( Channel.class );
|
||||
|
||||
public enum ChannelType
|
||||
{
|
||||
STANDARD,
|
||||
@@ -814,7 +819,7 @@ public class Channel extends Configuration
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.error( "Channel - attempt to add already existing channel "
|
||||
mLog.error( "Channel - attempt to add already existing channel "
|
||||
+ "listener [" + listener.getClass() + "]" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.awt.event.FocusEvent;
|
||||
import java.awt.event.FocusListener;
|
||||
|
||||
import javax.swing.AbstractCellEditor;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFormattedTextField;
|
||||
import javax.swing.JLabel;
|
||||
@@ -37,13 +36,18 @@ import javax.swing.JTextField;
|
||||
import javax.swing.table.TableCellEditor;
|
||||
import javax.swing.text.InternationalFormatter;
|
||||
|
||||
import log.Log;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ChannelMapEditor extends JPanel implements ActionListener
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private ChannelMapNode mChannelMapNode;
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( ChannelMapEditor.class );
|
||||
|
||||
private ChannelMapNode mChannelMapNode;
|
||||
|
||||
private JLabel mNameLabel;
|
||||
private JTextField mNameText;
|
||||
@@ -76,7 +80,7 @@ public class ChannelMapEditor extends JPanel implements ActionListener
|
||||
@Override
|
||||
public void focusLost( FocusEvent arg0 )
|
||||
{
|
||||
Log.info( "text field action event fired, new value:" + mNameText.getText() );
|
||||
mLog.info( "text field action event fired, new value:" + mNameText.getText() );
|
||||
mChannelMapCopy.setName( mNameText.getText() );
|
||||
}
|
||||
} );
|
||||
@@ -198,14 +202,13 @@ public class ChannelMapEditor extends JPanel implements ActionListener
|
||||
@Override
|
||||
public Object getCellEditorValue()
|
||||
{
|
||||
Log.info( "getCellEditorValue - I've been invoked!" );
|
||||
return mEditor.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed( ActionEvent e )
|
||||
{
|
||||
Log.info( "Action Performed:" + e.getActionCommand() );
|
||||
mLog.info( "Action Performed:" + e.getActionCommand() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,16 @@ package controller.channel;
|
||||
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
|
||||
import log.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ChannelMapModel extends AbstractTableModel
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final int sSTART = 0;
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( ChannelMapModel.class );
|
||||
|
||||
private static final int sSTART = 0;
|
||||
private static final int sSTOP = 1;
|
||||
private static final int sBASE = 2;
|
||||
private static final int sSIZE = 3;
|
||||
@@ -160,8 +164,8 @@ public class ChannelMapModel extends AbstractTableModel
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
Log.info( "ChannelMapModel - couldn't parse integer value "
|
||||
+ "for [" + value + "] - " + e.getLocalizedMessage() );
|
||||
mLog.error( "ChannelMapModel - couldn't parse integer value "
|
||||
+ "for [" + value + "]", e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
******************************************************************************/
|
||||
package controller.channel;
|
||||
|
||||
import gui.SDRTrunk;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -27,8 +29,11 @@ import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import log.Log;
|
||||
import message.Message;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import record.Recorder;
|
||||
import record.wave.ComplexWaveRecorder;
|
||||
import record.wave.FloatWaveRecorder;
|
||||
@@ -66,6 +71,8 @@ import eventlog.EventLogger;
|
||||
*/
|
||||
public class ProcessingChain implements Listener<Message>
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger( SDRTrunk.class );
|
||||
|
||||
protected AtomicBoolean mRunning = new AtomicBoolean();
|
||||
protected Channel mChannel;
|
||||
protected Source mSource;
|
||||
@@ -189,7 +196,7 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.info( getLogPrefix() + "start() invoked, but processing chain is "
|
||||
mLog.info( getLogPrefix() + "start() invoked, but processing chain is "
|
||||
+ "already started" );
|
||||
}
|
||||
}
|
||||
@@ -224,7 +231,7 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.info( getLogPrefix() + "stop() invoked, but processing chain was "
|
||||
mLog.info( getLogPrefix() + "stop() invoked, but processing chain was "
|
||||
+ "already stopped" );
|
||||
}
|
||||
}
|
||||
@@ -273,8 +280,8 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
catch ( SourceException e )
|
||||
{
|
||||
Log.error( "Couldn't obtain source for processing chain [" +
|
||||
toString() + "] - " + e.getLocalizedMessage() );
|
||||
mLog.error( "Couldn't obtain source for processing chain [" +
|
||||
toString() + "]", e );
|
||||
|
||||
mSource = null;
|
||||
}
|
||||
@@ -296,7 +303,7 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
catch( RejectedExecutionException ree )
|
||||
{
|
||||
Log.error( getLogPrefix() + "ProcessingChain - "
|
||||
mLog.error( getLogPrefix() + "ProcessingChain - "
|
||||
+ "error scheduling complex sample processing "
|
||||
+ "thread - " + ree.getLocalizedMessage() );
|
||||
|
||||
@@ -318,9 +325,9 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
catch( RejectedExecutionException ree )
|
||||
{
|
||||
Log.error( getLogPrefix() + "ProcessingChain - "
|
||||
mLog.error( getLogPrefix() + "ProcessingChain - "
|
||||
+ "error scheduling float sample processing "
|
||||
+ "thread - " + ree.getLocalizedMessage() );
|
||||
+ "thread", ree );
|
||||
|
||||
mSource.dispose();
|
||||
}
|
||||
@@ -340,9 +347,9 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
catch( RejectedExecutionException ree )
|
||||
{
|
||||
Log.error( getLogPrefix() + "ProcessingChain - "
|
||||
mLog.error( getLogPrefix() + "ProcessingChain - "
|
||||
+ "error scheduling float sample processing "
|
||||
+ "thread - " + ree.getLocalizedMessage() );
|
||||
+ "thread", ree );
|
||||
|
||||
mSource.dispose();
|
||||
}
|
||||
@@ -491,9 +498,8 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
catch ( IOException ioe )
|
||||
{
|
||||
Log.error( getLogPrefix() + "Couldn't stop recorder [" +
|
||||
recorder.getFileName() + "] " +
|
||||
ioe.getLocalizedMessage() );
|
||||
mLog.error( getLogPrefix() + "Couldn't stop recorder [" +
|
||||
recorder.getFileName() + "]", ioe );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -516,14 +522,14 @@ public class ProcessingChain implements Listener<Message>
|
||||
|
||||
if( recorder instanceof FloatWaveRecorder )
|
||||
{
|
||||
Log.info( getLogPrefix() + "- started audio recording [" +
|
||||
mLog.info( getLogPrefix() + "- started audio recording [" +
|
||||
recorder.getFileName() + "]" );
|
||||
|
||||
mDecoder.addFloatListener( (FloatWaveRecorder)recorder );
|
||||
}
|
||||
else if( recorder instanceof ComplexWaveRecorder )
|
||||
{
|
||||
Log.info( getLogPrefix() + "- started baseband recording [" +
|
||||
mLog.info( getLogPrefix() + "- started baseband recording [" +
|
||||
recorder.getFileName() + "]" );
|
||||
|
||||
mDecoder.addComplexListener( (ComplexWaveRecorder )recorder );
|
||||
@@ -532,7 +538,7 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
Log.error( getLogPrefix() + "Unable to start recorder [" +
|
||||
mLog.error( getLogPrefix() + "Unable to start recorder [" +
|
||||
recorder.getFileName() + "]" );
|
||||
}
|
||||
}
|
||||
@@ -638,7 +644,7 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.error( getLogPrefix() + "attempt to add a complex sample "
|
||||
mLog.error( getLogPrefix() + "attempt to add a complex sample "
|
||||
+ "listener, but the decoder is null" );
|
||||
}
|
||||
}
|
||||
@@ -651,7 +657,7 @@ public class ProcessingChain implements Listener<Message>
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.error( getLogPrefix() + "attempt to remove a complex sample "
|
||||
mLog.error( getLogPrefix() + "attempt to remove a complex sample "
|
||||
+ "listener, but the decoder is null" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
******************************************************************************/
|
||||
package controller.state;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
@@ -26,8 +25,11 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.swing.JTable;
|
||||
|
||||
import log.Log;
|
||||
import message.Message;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import properties.SystemProperties;
|
||||
import sample.Broadcaster;
|
||||
import sample.Listener;
|
||||
@@ -43,7 +45,6 @@ import controller.activity.CallEventModel;
|
||||
import controller.activity.MessageActivityModel;
|
||||
import controller.channel.Channel.ChannelType;
|
||||
import controller.channel.ProcessingChain;
|
||||
import decode.mpt1327.MPT1327CallEvent;
|
||||
|
||||
/**
|
||||
* ChannelState provides a state machine for tracking a voice or data call
|
||||
@@ -82,6 +83,9 @@ import decode.mpt1327.MPT1327CallEvent;
|
||||
*/
|
||||
public abstract class ChannelState implements Listener<Message>
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( ChannelState.class );
|
||||
|
||||
private State mState = State.IDLE;
|
||||
private Object mCallFadeLock = new Object();
|
||||
private Object mCallResetLock = new Object();
|
||||
@@ -349,7 +353,7 @@ public abstract class ChannelState implements Listener<Message>
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.error( "Channel State - can't change from [" +
|
||||
mLog.error( "Channel State - can't change from [" +
|
||||
mState.toString() + "] to [" + state.toString() + "]" );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user