Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MECLIPSE-2018: Removed the now obsolete org.maven.ide.eclipse.log bundle

  • Loading branch information...
commit c3e0ee8b39b7dad0a6fd514f09914400b9ed5e4b 1 parent 4844321
@vladt vladt authored
View
2  eclipse-commons-parent/pom.xml
@@ -25,7 +25,7 @@
<packaging>pom</packaging>
<properties>
- <m2eclipse-core.version>0.13.0/N/0.13.0.201102141615</m2eclipse-core.version>
+ <m2eclipse-core.version>0.13.0/N/0.13.0.201102150909</m2eclipse-core.version>
<tycho-version>0.10.0</tycho-version>
View
4 org.maven.ide.eclipse.log/.gitignore
@@ -1,4 +0,0 @@
-/.settings
-/target
-/.classpath
-/.project
View
16 org.maven.ide.eclipse.log/META-INF/MANIFEST.MF
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Log
-Bundle-SymbolicName: org.maven.ide.eclipse.log;singleton:=true
-Bundle-Version: 1.1.7.qualifier
-Bundle-Vendor: Sonatype, Inc.
-Bundle-Activator: org.maven.ide.eclipse.log.internal.LogPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
-Bundle-ClassPath: .
-Require-Bundle: org.eclipse.core.runtime,
- ch.qos.logback.classic;bundle-version="0.9.19",
- ch.qos.logback.core;bundle-version="0.9.19",
- org.slf4j.api;bundle-version="1.5.11"
-Export-Package: org.maven.ide.eclipse.log,
- org.maven.ide.eclipse.log.internal;x-internal:=true
View
5 org.maven.ide.eclipse.log/build.properties
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- plugin.xml,\
- .
View
35 org.maven.ide.eclipse.log/jars/logback.xml
@@ -1,35 +0,0 @@
-<configuration scan="true">
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%date [%thread] %-5level %logger{35} - %msg%n</Pattern>
- </layout>
- </appender>
-
- <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <File>${org.maven.ide.eclipse.log.dir}/0.log</File>
- <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <FileNamePattern>${org.maven.ide.eclipse.log.dir}/%i.log</FileNamePattern>
- <MinIndex>1</MinIndex>
- <MaxIndex>10</MaxIndex>
- </rollingPolicy>
- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <MaxFileSize>10MB</MaxFileSize>
- </triggeringPolicy>
- <layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%date [%thread] %-5level %logger{35} - %msg%n</Pattern>
- </layout>
- </appender>
-
- <root level="debug">
- <appender-ref ref="FILE" />
- <appender-ref ref="STDOUT" />
- </root>
-
- <logger name="org.apache.wink.client.ning" level="INFO" />
- <logger name="org.apache.wink.client.internal" level="INFO" />
- <logger name="org.apache.wink.common.internal" level="INFO" />
- <logger name="org.eclipse.jetty.http.ssl" level="INFO" />
- <logger name="org.eclipse.jetty.util.log" level="INFO" />
- <logger name="com.ning.http.client" level="INFO" />
- <logger name="com.sonatype.benson.rest.client" level="INFO" />
-</configuration>
View
9 org.maven.ide.eclipse.log/plugin.xml
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <!--
- <extension point="org.maven.ide.eclipse.pr.dataGatherers">
- <gatherer class="org.maven.ide.eclipse.log.internal.LogDataGatherer"/>
- </extension>
- -->
-</plugin>
View
16 org.maven.ide.eclipse.log/pom.xml
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.maven.ide.eclipse.commons</groupId>
- <artifactId>eclipse-commons-parent</artifactId>
- <version>1.1.7-SNAPSHOT</version>
- <relativePath>../eclipse-commons-parent</relativePath>
- </parent>
-
- <artifactId>org.maven.ide.eclipse.log</artifactId>
- <packaging>eclipse-plugin</packaging>
-
-</project>
View
25 org.maven.ide.eclipse.log/src/org/maven/ide/eclipse/log/LogHelper.java
@@ -1,25 +0,0 @@
-package org.maven.ide.eclipse.log;
-
-import java.util.Properties;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.slf4j.Logger;
-
-public class LogHelper
-{
- public static void logJavaProperties( Logger log )
- {
- Properties javaProperties = System.getProperties();
- SortedMap<String, String> sortedProperties = new TreeMap<String, String>();
- for ( Object key : javaProperties.keySet() )
- {
- sortedProperties.put( (String) key, (String) javaProperties.get( key ) );
- }
- log.info( "Java properties:" );
- for ( String key : sortedProperties.keySet() )
- {
- log.info( " {}={}", key, sortedProperties.get( key ) );
- }
- }
-}
View
34 org.maven.ide.eclipse.log/src/org/maven/ide/eclipse/log/internal/LogDataGatherer.java
@@ -1,34 +0,0 @@
-package org.maven.ide.eclipse.log.internal;
-
-
-public class LogDataGatherer
-// implements IDataGatherer
-{
-
- // public void gather( IDataGatheringContext context )
- // throws CoreException
- // {
- // String logDir = System.getProperty( LogPlugin.PROPERTY_LOG_DIRECTORY, "" );
- // if ( logDir.length() <= 0 )
- // {
- // return;
- // }
- //
- // File dir = new File( logDir );
- // File[] logs = dir.listFiles();
- // if ( logs != null )
- // {
- // IDataTarget target = context.getTarget();
- // for ( File log : logs )
- // {
- // target.consume( "logs", new ExternalFileSource( log.getAbsolutePath(), log.getName() ) );
- // }
- // }
- // }
- //
- // public String getName()
- // {
- // return "Maven Logs";
- // }
-
-}
View
128 org.maven.ide.eclipse.log/src/org/maven/ide/eclipse/log/internal/LogListener.java
@@ -1,128 +0,0 @@
-package org.maven.ide.eclipse.log.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class LogListener
- implements ILogListener
-{
-
- public void logging( IStatus status, String plugin )
- {
- String name = status.getPlugin();
- if ( name == null )
- {
- name = plugin;
- }
-
- Logger logger = LoggerFactory.getLogger( name );
-
- Log log;
- switch ( status.getSeverity() )
- {
- case IStatus.ERROR:
- log = ERROR;
- break;
- case IStatus.WARNING:
- log = WARN;
- break;
- default:
- log = INFO;
- break;
- }
-
- if ( !log.isEnabled( logger ) )
- {
- return;
- }
-
- log( log, logger, status );
- }
-
- private void log( Log log, Logger logger, IStatus status )
- {
- if ( status == null )
- {
- return;
- }
-
- Throwable exception = status.getException();
-
- log.log( logger, status.getMessage(), exception );
-
- if ( exception instanceof CoreException )
- {
- log( log, logger, ( (CoreException) exception ).getStatus() );
- }
-
- if ( status.isMultiStatus() )
- {
- IStatus[] children = status.getChildren();
- if ( children != null )
- {
- for ( int i = 0; i < children.length; i++ )
- {
- log( log, logger, children[i] );
- }
- }
- }
- }
-
- private static interface Log
- {
-
- boolean isEnabled( Logger logger );
-
- void log( Logger logger, String message, Throwable exception );
-
- }
-
- private static final Log ERROR = new Log()
- {
-
- public boolean isEnabled( Logger logger )
- {
- return logger.isErrorEnabled();
- }
-
- public void log( Logger logger, String message, Throwable exception )
- {
- logger.error( message, exception );
- }
-
- };
-
- private static final Log WARN = new Log()
- {
-
- public boolean isEnabled( Logger logger )
- {
- return logger.isWarnEnabled();
- }
-
- public void log( Logger logger, String message, Throwable exception )
- {
- logger.warn( message, exception );
- }
-
- };
-
- private static final Log INFO = new Log()
- {
-
- public boolean isEnabled( Logger logger )
- {
- return logger.isInfoEnabled();
- }
-
- public void log( Logger logger, String message, Throwable exception )
- {
- logger.info( message, exception );
- }
-
- };
-
-}
View
126 org.maven.ide.eclipse.log/src/org/maven/ide/eclipse/log/internal/LogPlugin.java
@@ -1,126 +0,0 @@
-package org.maven.ide.eclipse.log.internal;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-import org.slf4j.LoggerFactory;
-
-import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.joran.JoranConfigurator;
-import ch.qos.logback.classic.util.ContextInitializer;
-import ch.qos.logback.core.joran.spi.JoranException;
-import ch.qos.logback.core.util.StatusPrinter;
-
-public class LogPlugin
- extends Plugin
-{
-
- private final LogListener logListener = new LogListener();
-
- public static final String PROPERTY_LOG_DIRECTORY = "org.maven.ide.eclipse.log.dir";
-
- public static final String PROPERTY_LOG_FILE = "org.maven.ide.eclipse.log.file";
-
- @Override
- public void start( BundleContext context )
- throws Exception
- {
- super.start( context );
-
- configureLogger();
-
- Platform.addLogListener( logListener );
- }
-
- private void configureLogger()
- {
- if ( System.getProperty( ContextInitializer.CONFIG_FILE_PROPERTY ) != null )
- {
- return;
- }
-
- File stateDir = getStateLocation().toFile();
-
- File configFile = new File( stateDir, "logback.xml" );
-
- if ( !configFile.isFile() )
- {
- try
- {
- InputStream is = getClass().getResourceAsStream( "/jars/logback.xml" );
- try
- {
- configFile.getParentFile().mkdirs();
- FileOutputStream fos = new FileOutputStream( configFile );
- try
- {
- for ( byte[] buffer = new byte[1024 * 4];; )
- {
- int n = is.read( buffer );
- if ( n < 0 )
- {
- break;
- }
- fos.write( buffer, 0, n );
- }
- }
- finally
- {
- fos.close();
- }
- }
- finally
- {
- is.close();
- }
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- return;
- }
- }
-
- try
- {
- if ( System.getProperty( PROPERTY_LOG_DIRECTORY, "" ).length() <= 0 )
- {
- System.setProperty( PROPERTY_LOG_DIRECTORY, stateDir.getAbsolutePath() );
- }
-
- configureLogger( configFile.toURL() );
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
- }
-
- public static void configureLogger( URL configFile )
- throws JoranException
- {
- LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
- lc.reset();
-
- JoranConfigurator configurator = new JoranConfigurator();
- configurator.setContext( lc );
- configurator.doConfigure( configFile );
-
- StatusPrinter.printInCaseOfErrorsOrWarnings( lc );
- }
-
- @Override
- public void stop( BundleContext context )
- throws Exception
- {
- Platform.removeLogListener( logListener );
-
- super.stop( context );
- }
-
-}
Please sign in to comment.
Something went wrong with that request. Please try again.