From 5e5c388692b1126c9156421fe887c57d708444b7 Mon Sep 17 00:00:00 2001 From: Kevin Bisanz Date: Tue, 15 Dec 2015 16:34:11 -0600 Subject: [PATCH] Omaha #5166: Update logging to use SLF4J:grib,obs,warning amend: Update Bundle-Version in manifest Change-Id: I68e20f62d8e4049a41ab68015ae557f235ea38f8 Former-commit-id: 0385f259aa759953c9253d39c3e3681d453b826d --- .../META-INF/MANIFEST.MF | 2 +- .../grib/util/Grib1ParameterLookup.java | 7 +-- .../plugin/grib/util/GribModelLookup.java | 7 +-- .../META-INF/MANIFEST.MF | 4 +- .../raytheon/edex/plugin/obs/ObsDecoder.java | 7 +-- .../edex/plugin/obs/metar/MetarSeparator.java | 43 ++++++++++--------- .../META-INF/MANIFEST.MF | 1 - 7 files changed, 38 insertions(+), 33 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.plugin.grib/META-INF/MANIFEST.MF index 31be7a709c..e2f5a20a29 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.plugin.grib/META-INF/MANIFEST.MF @@ -27,4 +27,4 @@ Export-Package: com.raytheon.edex.plugin.grib, com.raytheon.edex.plugin.grib.util, com.raytheon.edex.util.grib Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: org.apache.commons.logging +Import-Package: org.slf4j diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/Grib1ParameterLookup.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/Grib1ParameterLookup.java index 690741690a..fbff70d3e2 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/Grib1ParameterLookup.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/Grib1ParameterLookup.java @@ -24,8 +24,8 @@ import java.io.File; 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.grib.exception.GribException; import com.raytheon.uf.common.localization.IPathManager; @@ -47,6 +47,7 @@ import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; * Mar 09, 2010 4758 bphillip Initial Creation * Oct 15, 2013 2473 bsteffen Remove deprecated method calls. * Jul 21, 2014 3373 bclement JAXB manager API changes + * Dec 15, 2015 5166 kbisanz Update logging to use SLF4J * * * @@ -58,7 +59,7 @@ public class Grib1ParameterLookup { + "grib1ParameterConvTable.xml"; /** The logger */ - protected transient Log logger = LogFactory.getLog(getClass()); + protected transient Logger logger = LoggerFactory.getLogger(getClass()); /** The singleton instance */ private static Grib1ParameterLookup instance; diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java index 6a20481976..420f57f0d4 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java @@ -25,8 +25,8 @@ import java.util.Set; import javax.xml.bind.JAXB; -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.grib.spatial.GribSpatialCache; import com.raytheon.uf.common.dataplugin.grid.mapping.DatasetIdMapper; @@ -58,6 +58,7 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException; * Apr 25, 2014 2874 bsteffen Add processType * Jul 02, 2014 3230 rferrel Recursively get model files in initModelList. * Jul 30, 2014 3455 bsteffen Allow model matching with no grid defined. + * Dec 15, 2015 5166 kbisanz Update logging to use SLF4J * * * @@ -70,7 +71,7 @@ public class GribModelLookup { .getHandler(GribModelLookup.class); /** The logger */ - protected transient Log logger = LogFactory.getLog(getClass()); + protected transient Logger logger = LoggerFactory.getLogger(getClass()); /** The singleton instance of GribModelLookup **/ private static GribModelLookup instance; diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/MANIFEST.MF index 3273b0ab50..566a6eff9a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Obs Plug-in Bundle-SymbolicName: com.raytheon.edex.plugin.obs -Bundle-Version: 1.14.0.qualifier +Bundle-Version: 1.15.0.qualifier Bundle-Vendor: RAYTHEON Export-Package: com.raytheon.edex.plugin.obs, com.raytheon.edex.plugin.obs.metar, @@ -24,4 +24,4 @@ Import-Package: com.raytheon.uf.common.dataplugin.obs.metar, com.raytheon.uf.common.dataplugin.obs.metar.util, com.raytheon.uf.common.status, com.raytheon.uf.common.wmo, - org.apache.commons.logging + org.slf4j diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/ObsDecoder.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/ObsDecoder.java index 2f02246324..268d2f580f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/ObsDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/ObsDecoder.java @@ -20,8 +20,8 @@ package com.raytheon.edex.plugin.obs; -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; @@ -56,6 +56,7 @@ import com.raytheon.uf.common.wmo.WMOHeader; * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Oct 23, 2013 2361 njensen Removed dead mesowest code * May 14, 2014 2536 bclement moved WMO Header to common + * Dec 15, 2015 5166 kbisanz Update logging to use SLF4J * * * @author bphillip @@ -63,7 +64,7 @@ import com.raytheon.uf.common.wmo.WMOHeader; */ public class ObsDecoder extends AbstractDecoder { /** The logger */ - private final Log logger = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); private final IPerformanceStatusHandler perfLog = PerformanceStatus .getHandler("Obs:"); diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarSeparator.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarSeparator.java index 9afdfbfea4..0814481f96 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarSeparator.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarSeparator.java @@ -32,8 +32,8 @@ import java.util.NoSuchElementException; 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.exception.DecoderException; @@ -51,14 +51,15 @@ import com.raytheon.uf.common.wmo.WMOHeader; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * July2006 3 & 14 Phillippe Initial Creation - * 14Nov2006 71 Rockwood Implemented filter for NIL observations - * 20080418 1093 jkorman Added filter for Alaskan "Airways" + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Jul ??, 2006 3 & 14 Phillippe Initial Creation + * Nov 14, 2006 71 Rockwood Implemented filter for NIL observations + * Apr 14, 2008 1093 jkorman Added filter for Alaskan "Airways" * observations. - * May 14, 2014 2536 bclement moved WMO Header to common, removed unused HEADERREGEX - * Oct 02, 2014 3693 mapeters Changed pattern String constants to Pattern constants. + * May 14, 2014 2536 bclement moved WMO Header to common, removed unused HEADERREGEX + * Oct 02, 2014 3693 mapeters Changed pattern String constants to Pattern constants. + * Dec 15, 2015 5166 kbisanz Update logging to use SLF4J * * * @author bphillip @@ -73,7 +74,7 @@ import com.raytheon.uf.common.wmo.WMOHeader; */ public class MetarSeparator extends AbstractRecordSeparator { - private final Log theLogger = LogFactory.getLog(getClass()); + private final Logger theLogger = LoggerFactory.getLogger(getClass()); /** Regex used for separating multi-record files */ private static final Pattern ICAODATEPAIR = Pattern @@ -112,12 +113,13 @@ public class MetarSeparator extends AbstractRecordSeparator { /** * Get the WMO Header found within this data. + * * @return The message WMO Header. */ public WMOHeader getWMOHeader() { return header; } - + /* * (non-Javadoc) * @@ -171,16 +173,16 @@ public class MetarSeparator extends AbstractRecordSeparator { try { // Extracts the header WMOHeader wmoHeader = new WMOHeader(message.getBytes()); - if(wmoHeader.isValid()) { + if (wmoHeader.isValid()) { header = wmoHeader; } - -// Pattern pattern = Pattern.compile(HEADERREGEX); -// Matcher matcher = pattern.matcher(message); -// -// if (matcher.find()) { -// header = matcher.group(); -// } + + // Pattern pattern = Pattern.compile(HEADERREGEX); + // Matcher matcher = pattern.matcher(message); + // + // if (matcher.find()) { + // header = matcher.group(); + // } // Determines the type Matcher matcher = METARTYPE.matcher(message); @@ -249,7 +251,8 @@ public class MetarSeparator extends AbstractRecordSeparator { // Check for NIL observations and, if found, throw out matcher = NILREGEX.matcher(observation); if (!matcher.find()) { - String record = header.getWmoHeader() + "\n" + type + " " + observation; + String record = header.getWmoHeader() + "\n" + type + " " + + observation; records.add(record); } } diff --git a/edexOsgi/com.raytheon.edex.plugin.warning/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.plugin.warning/META-INF/MANIFEST.MF index 81b7a152bf..2f0df991fa 100644 --- a/edexOsgi/com.raytheon.edex.plugin.warning/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.plugin.warning/META-INF/MANIFEST.MF @@ -20,5 +20,4 @@ Require-Bundle: org.geotools, Export-Package: com.raytheon.edex.plugin.warning.tools Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: com.raytheon.uf.common.time, - org.apache.commons.logging, org.hibernate.annotations