Author: aheritier Date: Sat Jan 14 15:15:14 2006 New Revision: 369113 URL: http://svn.apache.org/viewcvs?rev=369113&view=rev Log: use a static logger
Modified: maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java Modified: maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java?rev=369113&r1=369112&r2=369113&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java (original) +++ maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java Sat Jan 14 15:15:14 2006 @@ -55,7 +55,7 @@ /** * Log for debug output. */ - private static Log log = LogFactory.getLog( JiraDownloader.class ); + private static final Log LOG = LogFactory.getLog( JiraDownloader.class ); /** Mapping containing all JIRA status values. */ private static Map statusMap = new HashMap(); @@ -109,16 +109,16 @@ /** The component to show. */ private String component; - /** The username to log into JIRA. */ + /** The username to LOG into JIRA. */ private String jiraUser; - /** The password to log into JIRA. */ + /** The password to LOG into JIRA. */ private String jiraPassword; - /** The username to log into webserver. */ + /** The username to LOG into webserver. */ private String webUser; - /** The password to log into webserver. */ + /** The password to LOG into webserver. */ private String webPassword; /** The maven project. */ @@ -268,7 +268,7 @@ jiraUrl = jiraUrl.substring( 0, jiraUrl.lastIndexOf( "/" ) ); } - log.info( "Jira lives at: " + jiraUrl ); + LOG.info( "Jira lives at: " + jiraUrl ); doAuthentication( cl, jiraUrl ); String projectPage = ""; @@ -282,17 +282,17 @@ try { cl.executeMethod( gm ); - log.info( "Succesfully reached JIRA." ); + LOG.info( "Succesfully reached JIRA." ); } catch ( Exception e ) { - if ( log.isDebugEnabled() ) + if ( LOG.isDebugEnabled() ) { - log.error( "Unable to reach JIRA project page:", e ); + LOG.error( "Unable to reach JIRA project page:", e ); } else { - log.error( + LOG.error( "Unable to reach JIRA project page. Cause is: " + e.getLocalizedMessage() ); } @@ -303,7 +303,7 @@ if ( id == null ) { - log.info( "Jira URL " + url + LOG.info( "Jira URL " + url + " doesn't include a pid, trying to get it" ); int pidIndex = projectPage.indexOf( "pid=" ); // @todo, a safer way to get the PID @@ -311,7 +311,7 @@ if ( pidIndex == -1 ) { // fail - log.error( "Unable to get JIRA pid using url " + LOG.error( "Unable to get JIRA pid using url " + project.getIssueTrackingUrl() ); return; @@ -342,7 +342,7 @@ if ( fixforIndex == -1 ) { // fail - log.error( "Unable to get JIRA roadmap using url " + LOG.error( "Unable to get JIRA roadmap using url " + project.getIssueTrackingUrl() ); return; @@ -373,7 +373,7 @@ } catch ( Exception e ) { - log.error( "Error accessing " + project.getIssueTrackingUrl(), e ); + LOG.error( "Error accessing " + project.getIssueTrackingUrl(), e ); } } @@ -395,13 +395,13 @@ Credentials defaultcreds = new UsernamePasswordCredentials( webUser, webPassword ); - log.info( "Using username: " + webUser + LOG.info( "Using username: " + webUser + " for Basic Authentication against the webserver at " + jiraUrl ); client.getState().setCredentials( null, null, defaultcreds ); } - // log into JIRA if we have to + // LOG into JIRA if we have to String loginUrl = null; if ( ( jiraUser != null ) && ( jiraUser.length() > 0 ) @@ -411,7 +411,7 @@ loginLink.append( "/login.jsp?os_destination=/secure/" ); loginLink.append( "&os_username=" ).append( jiraUser ); - log.info( "Login URL: " + loginLink + "&os_password=*******" ); + LOG.info( "Login URL: " + loginLink + "&os_password=*******" ); loginLink.append( "&os_password=" ).append( jiraPassword ); loginUrl = loginLink.toString(); } @@ -424,17 +424,17 @@ try { client.executeMethod( loginGet ); - log.info( "Succesfully logged in into JIRA." ); + LOG.info( "Succesfully logged in into JIRA." ); } catch ( Exception e ) { - if ( log.isDebugEnabled() ) + if ( LOG.isDebugEnabled() ) { - log.error( "Error trying to login into JIRA:", e ); + LOG.error( "Error trying to login into JIRA:", e ); } else { - log.error( "Error trying to login into JIRA. Cause is: " + LOG.error( "Error trying to login into JIRA. Cause is: " + e.getLocalizedMessage() ); } @@ -454,7 +454,7 @@ // see whether there is any proxy defined in maven if ( project == null ) { - log.error( "No project set. No proxy info available." ); + LOG.error( "No project set. No proxy info available." ); return; } @@ -463,7 +463,7 @@ if ( ctx == null ) { - log.error( "Maven project has no context. No proxy info available." ); + LOG.error( "Maven project has no context. No proxy info available." ); return; } @@ -476,13 +476,13 @@ client.getHostConfiguration().setProxy( proxyHost, Integer.parseInt( proxyPort ) ); - log.info( "Using proxy: " + proxyHost + " at port " + proxyPort ); + LOG.info( "Using proxy: " + proxyHost + " at port " + proxyPort ); String proxyUser = ctx.getProxyUserName(); if ( proxyUser != null ) { - log.info( "Using proxy user: " + proxyUser ); + LOG.info( "Using proxy user: " + proxyUser ); String proxyPass = ctx.getProxyPassword(); @@ -510,7 +510,7 @@ { GetMethod gm = new GetMethod( link ); - log.info( "Downloading " + link ); + LOG.info( "Downloading " + link ); gm.setFollowRedirects( true ); cl.executeMethod( gm ); @@ -526,7 +526,7 @@ if ( sl == null ) { - log.info( "Unknown error validating link : " + link ); + LOG.info( "Unknown error validating link : " + link ); return; } @@ -538,50 +538,50 @@ if ( locationHeader == null ) { - log.info( "Site sent redirect, but did not set Location header" ); + LOG.info( "Site sent redirect, but did not set Location header" ); } else { String newLink = locationHeader.getValue(); - log.debug( "Following redirect to " + newLink ); + LOG.debug( "Following redirect to " + newLink ); download( cl, newLink, outFile ); } } if ( gm.getStatusCode() != HttpStatus.SC_OK ) { - log.warn( "Received: [" + gm.getStatusCode() + "]" ); + LOG.warn( "Received: [" + gm.getStatusCode() + "]" ); } } catch ( HttpException e ) { - if ( log.isDebugEnabled() ) + if ( LOG.isDebugEnabled() ) { - log.error( "Error downloading issues from JIRA:", e ); + LOG.error( "Error downloading issues from JIRA:", e ); } else { - log.error( "Error downloading issues from JIRA. Cause is: " + LOG.error( "Error downloading issues from JIRA. Cause is: " + e.getLocalizedMessage() ); } } catch ( IOException e ) { - if ( log.isDebugEnabled() ) + if ( LOG.isDebugEnabled() ) { - log.error( "Error downloading issues from JIRA:", e ); + LOG.error( "Error downloading issues from JIRA:", e ); } else { - log.error( "Error downloading issues from JIRA. Cause is: " + LOG.error( "Error downloading issues from JIRA. Cause is: " + e.getLocalizedMessage() ); } } } /** - * Set the output file for the log. + * Set the output file for the LOG. * * @param thisOutput * the output file @@ -669,7 +669,7 @@ } /** - * Sets the password to log into a secured JIRA. + * Sets the password to LOG into a secured JIRA. * * @param thisJiraPassword * The password for JIRA @@ -680,7 +680,7 @@ } /** - * Sets the username to log into a secured JIRA. + * Sets the username to LOG into a secured JIRA. * * @param thisJiraUser * The username for JIRA