Omaha #5166: Update logging to use SLF4J:sfcobs

Update the following to use SLF4J:
com.raytheon.edex.plugin.sfcobs

Change-Id: I07993deeef9124592e7457fe9621d1e7cdc9339a

Former-commit-id: 9c5ab139702f30142d36264c7b57a7d97ba85d59
This commit is contained in:
Kevin Bisanz 2015-12-17 17:55:28 -06:00
parent 1711db0967
commit a4c55cc55e
11 changed files with 89 additions and 75 deletions

View file

@ -24,8 +24,8 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.exception.DecoderException;
@ -73,6 +73,7 @@ import com.raytheon.uf.edex.decodertools.core.DecoderTools;
* added status to decode.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* </pre>
*
* @author jkorman
@ -88,7 +89,7 @@ public class SfcObsDecoder extends AbstractDecoder {
.getHandler("SfcObs:");
/** The logger */
private final Log logger = LogFactory.getLog(getClass());
private final Logger logger = LoggerFactory.getLogger(getClass());
private boolean removeNILs = true;

View file

@ -27,8 +27,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.sfcobs.AncPrecip;
@ -49,10 +49,11 @@ import com.raytheon.uf.common.serialization.SerializationException;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 1, 2009 jkorman Initial creation
* Feb 15,2011 5705 cjeanbap Added wmoHeader to HDR_PARAMS_LIST.
* Apr 04,2014 2906 bclement made getDescription() and static constants public
* Apr 22,2014 2906 bclement removed WMO header, timeObs and timeNominal from HDF5 (times still in DB)
* Oct 01, 2009 jkorman Initial creation
* Feb 15, 2011 5705 cjeanbap Added wmoHeader to HDR_PARAMS_LIST.
* Apr 04, 2014 2906 bclement made getDescription() and static constants public
* Apr 22, 2014 2906 bclement removed WMO header, timeObs and timeNominal from HDF5 (times still in DB)
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
*
* </pre>
*
@ -63,8 +64,8 @@ import com.raytheon.uf.common.serialization.SerializationException;
public class SfcObsPointDataTransform {
/** The logger */
private static Log logger = LogFactory
.getLog(SfcObsPointDataTransform.class);
private static Logger logger = LoggerFactory
.getLogger(SfcObsPointDataTransform.class);
public static final int INT_DEFAULT = -9999;

View file

@ -25,8 +25,8 @@ import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator;
@ -53,9 +53,10 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20070925 391 jkorman Initial Coding.
* 20070925 391 jkorman Initial Coding.
* May 14, 2014 2536 bclement moved WMO Header to common
* Sep 26, 2014 3629 mapeters Added SOM constant, replaced static imports.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* </pre>
*
* @author jkorman
@ -63,7 +64,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
*/
public class SfcObsSeparator extends AbstractRecordSeparator {
/** The logger */
private Log logger = LogFactory.getLog(getClass());
private Logger logger = LoggerFactory.getLogger(getClass());
private static final String SOM = String
.valueOf((char) IDecoderConstants.ASCII_SOM);

View file

@ -22,8 +22,8 @@ package com.raytheon.edex.plugin.sfcobs.decoder;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.plugin.sfcobs.decoder.buoy.DRIBUSynopticDecoder;
import com.raytheon.edex.plugin.sfcobs.decoder.metar.METARDecoder;
@ -45,8 +45,9 @@ import com.raytheon.uf.common.wmo.WMOHeader;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20070925 391 jkorman Initial Coding.
* Sep 26, 2014 3629 mapeters Added SPACE_CHAR constant.
* 20070925 391 jkorman Initial Coding.
* Sep 26, 2014 3629 mapeters Added SPACE_CHAR constant.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* </pre>
*
* @author jkorman
@ -54,7 +55,8 @@ import com.raytheon.uf.common.wmo.WMOHeader;
*/
public class SfcObsDecoderFactory {
/** The logger */
private static Log logger = LogFactory.getLog(SfcObsDecoderFactory.class);
private static Logger logger = LoggerFactory
.getLogger(SfcObsDecoderFactory.class);
private static final char SPACE_CHAR = ' ';
@ -95,9 +97,9 @@ public class SfcObsDecoderFactory {
try {
decoder = clazz.newInstance();
} catch (InstantiationException e) {
logger.error(e);
logger.error("Error getting decoder instance", e);
} catch (IllegalAccessException e) {
logger.error(e);
logger.error("Error getting decoder instance", e);
}
}
if (decoder != null) {

View file

@ -19,8 +19,8 @@
**/
package com.raytheon.edex.plugin.sfcobs.decoder.metar;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
@ -36,7 +36,8 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20070928 391 jkorman Initial Coding.
* 20070928 391 jkorman Initial Coding.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* </pre>
*
* @author jkorman
@ -45,7 +46,7 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
public class METARDecoder extends AbstractSfcObsDecoder {
/** The logger */
private Log logger = LogFactory.getLog(getClass());
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* Construct the decoder.

View file

@ -19,8 +19,8 @@
**/
package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
@ -44,9 +44,10 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
* ------------ ---------- ----------- --------------------------
* 20070928 391 jkorman Initial Coding.
* Dec 17, 2007 600 bphillip Added dao pool usage
* 20080116 798 jkorman Changed logging levels.
* 20080116 798 jkorman Changed logging levels.
* Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin
* Sep 30, 2014 3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()} calls.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* </pre>
*
* @author jkorman
@ -55,7 +56,7 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
public class CMANSynopticDecoder extends LandSynopticDecoder {
/** The logger */
private Log logger = LogFactory.getLog(getClass());
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* Construct an instance of a Coastal Marine observation decoder.
@ -130,13 +131,13 @@ public class CMANSynopticDecoder extends LandSynopticDecoder {
setWmoRegion(stationInfo.getWmoRegion());
} else {
// The NDM data doesn't discriminate between CMAN and
// fixed buoy identifiers unless manually modified.
// fixed buoy identifiers unless manually modified.
gid = ObStation.createGID(ObStation.CAT_TYPE_BUOY_FXD,
staId);
stationInfo = obSta.queryByGid(gid);
if (stationInfo != null) {
logger.debug("Processing CMAN[" + getReportIdentifier()
+ "]");
logger.debug("Processing CMAN["
+ getReportIdentifier() + "]");
setWmoRegion(stationInfo.getWmoRegion());
} else {
logger.info("Station id not found ["

View file

@ -22,8 +22,8 @@ package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
@ -51,9 +51,10 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
* ------------ ---------- ----------- --------------------------
* 20070928 391 jkorman Initial Coding.
* Dec 17, 2007 600 bphillip Added dao pool usage
* 20080116 798 jkorman Changed logging levels.
* 20080116 798 jkorman Changed logging levels.
* Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin
* Sep 30, 2014 3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()} calls.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* </pre>
*
* @author jkorman
@ -62,7 +63,7 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
public class LandSynopticDecoder extends AbstractSynopticDecoder {
// The logger
private Log logger = LogFactory.getLog(getClass());
private Logger logger = LoggerFactory.getLogger(getClass());
protected ObStation stationInfo = null;

View file

@ -19,8 +19,8 @@
**/
package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
@ -37,9 +37,10 @@ import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20071010 391 jkorman Initial coding.
* 20071217 453 jkorman Added code to report MAROB report type.
* Sep 30, 2014 3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()} calls.
* 20071010 391 jkorman Initial coding.
* 20071217 453 jkorman Added code to report MAROB report type.
* Sep 30, 2014 3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()} calls.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
*
* </pre>
*
@ -50,7 +51,7 @@ import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
public class MAROBSynopticDecoder extends SHIPSynopticDecoder {
// The logger
private Log logger = LogFactory.getLog(getClass());
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* Create and set up the MAROB synoptic decoder.

View file

@ -21,8 +21,8 @@ package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
@ -41,10 +41,11 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20070928 391 jkorman Initial Coding.
* 20070928 391 jkorman Initial Coding.
* Jul 23, 2014 3410 bclement location changed to floats
* Sep 30, 2014 3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()}
* calls, added ELEV_PATTERN.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* </pre>
*
* @author jkorman
@ -56,7 +57,7 @@ public class MobileSynopticDecoder extends AbstractSynopticDecoder {
.compile("[/0-9]{4}[1-8]");
// The logger
private Log logger = LogFactory.getLog(getClass());
private Logger logger = LoggerFactory.getLogger(getClass());
private Float mobileLatitude = null;

View file

@ -19,8 +19,8 @@
**/
package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
@ -44,13 +44,14 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20070928 391 jkorman Initial Coding.
* 20080106 391 jkorman Corrected ship longitude decode.
* 20080108 721 jkorman Added buoy id query.
* 20120619 DR 14015 mporricelli Added elevation for fixed buoys
* 20070928 391 jkorman Initial Coding.
* 20080106 391 jkorman Corrected ship longitude decode.
* 20080108 721 jkorman Added buoy id query.
* 20120619 DR 14015 mporricelli Added elevation for fixed buoys
* Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin
* Jul 23, 2014 3410 bclement location changed to floats
* Sep 30, 2014 3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()} calls.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* </pre>
*
* @author jkorman
@ -59,14 +60,14 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
public class SHIPSynopticDecoder extends AbstractSynopticDecoder {
// The logger
private Log logger = LogFactory.getLog(getClass());
private Logger logger = LoggerFactory.getLogger(getClass());
protected Float shipLatitude = null;
protected Float shipLongitude = null;
protected Integer shipElev = null;
protected Integer shipQuadrant = null;
protected boolean isFixedBuoy = false;
@ -95,7 +96,7 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder {
isValid = reportPrefix.equals(element);
Double buoyLat = null;
Double buoyLon = null;
Integer buoyElev = null;
Integer buoyElev = null;
isFixedBuoy = false;
if (isValid) {
reportParser.next();
@ -117,10 +118,12 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder {
throw new DecoderException(
"Unable to retrieve station info", e);
}
if(staInfo != null) {
if (staInfo != null) {
isFixedBuoy = true;
buoyLat = DecoderTools.getCoordinateLatitude(staInfo.getStationGeom().getCoordinate());
buoyLon = DecoderTools.getCoordinateLongitude(staInfo.getStationGeom().getCoordinate());
buoyLat = DecoderTools.getCoordinateLatitude(staInfo
.getStationGeom().getCoordinate());
buoyLon = DecoderTools.getCoordinateLongitude(staInfo
.getStationGeom().getCoordinate());
buoyElev = staInfo.getElevation();
}
}
@ -159,12 +162,11 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder {
+ "---------------->");
decodeLatitude();
decodeLongitude();
if(isFixedBuoy) {
if (isFixedBuoy) {
// This change selects the common_obs_spatial location over the
// encoded location. This is so that moored buoy locations agree
// with the spi files
// with the spi files
shipLatitude = buoyLat != null ? buoyLat.floatValue() : null;
shipLongitude = buoyLon != null ? buoyLon.floatValue() : null;
shipElev = buoyElev;
@ -176,7 +178,8 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder {
} else {
if ((shipLatitude == null) || (shipLongitude == null)) {
clearSectionDecoders();
logger.error("BAD:YYGGI_SUB_W : " + reportParser.getReport());
logger.error("BAD:YYGGI_SUB_W : "
+ reportParser.getReport());
return;
}
adjustLatLon();

View file

@ -24,8 +24,8 @@ import java.util.regex.Pattern;
import javax.measure.converter.UnitConverter;
import javax.measure.unit.SI;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
@ -53,14 +53,15 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20071010 391 jkorman Initial coding.
* 20071203 410 jkorman JavaDoc complaints.
* 20080116 798 jkorman Changed logging levels.
* Sep 18, 2014 #3627 mapeters Convert units using {@link UnitConverter}, removed
* unused duration field, made patterns constant.
* Sep 26, 2014 #3629 mapeters Replaced static imports.
* Sep 30, 2014 #3629 mapeters Conformed to changes in ISynoptic constants.
* May 26, 2015 #4525 mapeters Fix pressure unit conversion.
* 20071010 391 jkorman Initial coding.
* 20071203 410 jkorman JavaDoc complaints.
* 20080116 798 jkorman Changed logging levels.
* Sep 18, 2014 3627 mapeters Convert units using {@link UnitConverter}, removed
* unused duration field, made patterns constant.
* Sep 26, 2014 3629 mapeters Replaced static imports.
* Sep 30, 2014 3629 mapeters Conformed to changes in ISynoptic constants.
* May 26, 2015 4525 mapeters Fix pressure unit conversion.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
*
* </pre>
*
@ -80,7 +81,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
private static final Pattern P912 = Pattern.compile("912\\d{2}");
/** The logger */
private Log logger = LogFactory.getLog(getClass());
private Logger logger = LoggerFactory.getLogger(getClass());
private DataItem maxTemperature = null; // (group 1xxxx)