From 663378ad200c7fda6b6d75048193a6af93c415d7 Mon Sep 17 00:00:00 2001 From: denny Date: Fri, 15 Jan 2016 09:50:10 -0500 Subject: [PATCH] Logging cleanup --- src/playlist/PlaylistManager.java | 22 ++++++--------- src/properties/SystemProperties.java | 20 ++++++-------- src/settings/SettingsManager.java | 27 +++++++------------ .../recording/RecordingSourceManager.java | 3 +-- 4 files changed, 27 insertions(+), 45 deletions(-) diff --git a/src/playlist/PlaylistManager.java b/src/playlist/PlaylistManager.java index 55ddd59b..c3a973b4 100644 --- a/src/playlist/PlaylistManager.java +++ b/src/playlist/PlaylistManager.java @@ -100,7 +100,7 @@ public class PlaylistManager } catch( Exception e ) { - mLog.error( "PlaylistManager - couldn't create file to save " + mLog.error( "couldn't create file to save " + "playlist [" + filePath.toString() + "]" ); } @@ -122,14 +122,12 @@ public class PlaylistManager } catch ( JAXBException e ) { - mLog.error( "PlaylistManager - jaxb exception while saving " + - "playlist: ", e ); + mLog.error( "jaxb exception while saving playlist: ", e ); } } catch ( Exception e ) { - mLog.error( "PlaylistManager - coulcn't open outputstream to " + - "save playlist [" + filePath.toString() + "]", e ); + mLog.error( "coulcn't open outputstream to save playlist [" + filePath.toString() + "]", e ); } finally { @@ -155,8 +153,7 @@ public class PlaylistManager { if( Files.exists( playlistPath ) ) { - mLog.info( "PlaylistManager - loading playlist file [" + - playlistPath.toString() + "]" ); + mLog.info( "loading playlist file [" + playlistPath.toString() + "]" ); JAXBContext context = null; @@ -176,14 +173,12 @@ public class PlaylistManager } catch ( JAXBException e ) { - mLog.error( "PlaylistManager - jaxb exception while loading " + - "playlist: ", e ); + mLog.error( "jaxb exception while loading playlist: ", e ); } } catch ( Exception e ) { - mLog.error( "PlaylistManager - coulcn't open inputstream to " + - "load playlist [" + playlistPath.toString() + "]", e ); + mLog.error( "coulcn't open inputstream to load playlist [" + playlistPath.toString() + "]", e ); } finally { @@ -195,7 +190,7 @@ public class PlaylistManager } catch ( IOException e ) { - mLog.error( "PlaylistManager - exception while closing " + + mLog.error( "exception while closing " + "the playlist file inputstream reader", e ); } } @@ -203,8 +198,7 @@ public class PlaylistManager } else { - mLog.info( "PlaylistManager - playlist does not exist [" + - playlistPath.toString() + "]" ); + mLog.info( "playlist does not exist [" + playlistPath.toString() + "]" ); } if( mPlaylist == null ) diff --git a/src/properties/SystemProperties.java b/src/properties/SystemProperties.java index bf4b33f4..eeb0feaa 100644 --- a/src/properties/SystemProperties.java +++ b/src/properties/SystemProperties.java @@ -87,13 +87,11 @@ public class SystemProperties mProperties.store( out, comments ); - mLog.info( "SystemProperties - saved current properties [" + - propsPath.toString() + "]" ); + mLog.info( "saved current properties [" + propsPath.toString() + "]" ); } catch( Exception e ) { - mLog.error( "SystemProperties - exception while saving " + - "application properties", e ); + mLog.error( "exception while saving application properties", e ); } finally { @@ -146,8 +144,7 @@ public class SystemProperties } catch ( IOException e ) { - mLog.error( "SystemProperties - exception while creating " + - "app folder [" + folder + "]", e ); + mLog.error( "exception while creating app folder [" + folder + "]", e ); } } @@ -158,11 +155,11 @@ public class SystemProperties { if( mPropertiesPath == null ) { - mLog.info( "SystemProperties - no properties file loaded - using defaults" ); + mLog.info( "no properties file loaded - using defaults" ); } else { - mLog.info( "SystemProperties - application properties loaded [" + mPropertiesPath.toString() + "]" ); + mLog.info( "application properties loaded [" + mPropertiesPath.toString() + "]" ); } } @@ -184,7 +181,7 @@ public class SystemProperties } catch ( FileNotFoundException e ) { - mLog.error( "SDRTrunk - exception while opening inputstream on " + + mLog.error( "exception while opening inputstream on " + "application properties file", e ); } @@ -196,7 +193,7 @@ public class SystemProperties } catch ( IOException e ) { - mLog.error( "SDRTrunk - exception while loading properties " + + mLog.error( "exception while loading properties " + "inputstream into SystemProperties", e ); } finally @@ -212,8 +209,7 @@ public class SystemProperties } } - mLog.info( "SystemProperties - loaded [" + - propertiesPath.toString() + "]" ); + mLog.info( "loaded [" + propertiesPath.toString() + "]" ); } /** diff --git a/src/settings/SettingsManager.java b/src/settings/SettingsManager.java index 281d2bed..ddcc4fa9 100644 --- a/src/settings/SettingsManager.java +++ b/src/settings/SettingsManager.java @@ -431,8 +431,7 @@ public class SettingsManager } /* Something happened ... the above should always return an icon */ - mLog.error( "SettingsManager - couldn't return an icon named [" + - name + "] of heigh [" + height + "]" ); + mLog.error( "couldn't return an icon named [" + name + "] of heigh [" + height + "]" ); } return null; @@ -630,8 +629,7 @@ public class SettingsManager return r820TConfig; default: - throw new IllegalArgumentException( "TunerConfiguration" - + "Directory - tuner type is unrecognized [" + + throw new IllegalArgumentException( "tuner type is unrecognized [" + type.toString() + "]" ); } } @@ -705,8 +703,7 @@ public class SettingsManager } catch( Exception e ) { - mLog.error( "SettingsManager - couldn't create file to save " - + "settings [" + filePath.toString() + "]", e ); + mLog.error( "couldn't create file to save settings [" + filePath.toString() + "]", e ); } OutputStream out = null; @@ -727,14 +724,12 @@ public class SettingsManager } catch ( JAXBException e ) { - mLog.error( "SettingsManager - jaxb exception while saving " + - "settings", e ); + mLog.error( "jaxb exception while saving settings", e ); } } catch ( Exception e ) { - mLog.error( "SettingsManager - coulcn't open outputstream to " + - "save settings [" + filePath.toString() + "]" ); + mLog.error( "couldn't open outputstream to save settings [" + filePath.toString() + "]" ); } finally { @@ -760,8 +755,7 @@ public class SettingsManager { if( Files.exists( settingsPath ) ) { - mLog.info( "SettingsManager - loading settings file [" + - settingsPath.toString() + "]" ); + mLog.info( "loading settings file [" + settingsPath.toString() + "]" ); JAXBContext context = null; @@ -781,13 +775,13 @@ public class SettingsManager } catch ( JAXBException e ) { - mLog.error( "SettingsManager - jaxb exception while loading " + + mLog.error( "jaxb exception while loading " + "settings", e ); } } catch ( Exception e ) { - mLog.error( "SettingsManager - coulcn't open inputstream to " + + mLog.error( "coulcn't open inputstream to " + "load settings [" + settingsPath.toString() + "]", e ); } finally @@ -800,7 +794,7 @@ public class SettingsManager } catch ( IOException e ) { - mLog.error( "SettingsManager - exception while closing " + + mLog.error( "exception while closing " + "the settings file inputstream reader", e ); } } @@ -808,8 +802,7 @@ public class SettingsManager } else { - mLog.info( "SettingsManager - settings does not exist [" + - settingsPath.toString() + "]" ); + mLog.info( "settings does not exist [" + settingsPath.toString() + "]" ); } if( mSettings == null ) diff --git a/src/source/recording/RecordingSourceManager.java b/src/source/recording/RecordingSourceManager.java index 63c03d8a..0fcabaef 100644 --- a/src/source/recording/RecordingSourceManager.java +++ b/src/source/recording/RecordingSourceManager.java @@ -143,8 +143,7 @@ public class RecordingSourceManager ArrayList recordingConfigurations = settingsManager.getRecordingConfigurations(); - mLog.info( "RecordingSourceManager - discovered [" + - recordingConfigurations.size() + "] recording configurations" ); + mLog.info( "discovered [" + recordingConfigurations.size() + "] recording configurations" ); for( RecordingConfiguration config: recordingConfigurations ) {