1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

[170920][api] Get rid of org.eclipse.rse.logging plugin

This commit is contained in:
Martin Oberhuber 2007-04-02 07:25:38 +00:00
parent 8bde9f14de
commit 41757435e3
25 changed files with 6 additions and 1153 deletions

View file

@ -24,7 +24,6 @@ plugin@org.eclipse.rse.eclipse.filesystem=v20070321,:pserver:anonymous:none@dev.
plugin@org.eclipse.rse.examples.daytime=v20070328,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/examples/org.eclipse.rse.examples.daytime
plugin@org.eclipse.rse.examples.tutorial=v20070328,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/examples/org.eclipse.rse.examples.tutorial
plugin@org.eclipse.rse.files.ui=v20070328,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui
plugin@org.eclipse.rse.logging=v20070328,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.logging
plugin@org.eclipse.rse.processes.ui=v20070328,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.processes.ui
plugin@org.eclipse.rse.remotecdt=v20070328,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt
plugin@org.eclipse.rse.sdk=v20070223,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.sdk

View file

@ -16,7 +16,7 @@ or want to use the common RSE log file.
<h2>Using Your Own Log File</h2>
<p>
The log file support is encapsulated in a separate plugin, <b><samp>org.eclipse.rse.logging</samp></b>, which
The log file support is encapsulated in the <b><samp>org.eclipse.rse.logging</samp></b> package, which
defines the primary <samp><A href="../../../reference/api/org/eclipse/rse/logging/Logger.html">org.eclipse.rse.logging.Logger</a></samp> class that manages the log file.
This log file support offers the ability to log the following types of log messages:</p>
<ul>

View file

@ -3,12 +3,10 @@
-charset "iso-8859-1"
-source 1.4
-sourcepath "../org.eclipse.rse.connectorservice.dstore/src
;../org.eclipse.rse.core/persistence
;../org.eclipse.rse.core/src
;../org.eclipse.rse.dstore.security/src
;../org.eclipse.rse.eclipse.filesystem/src
;../org.eclipse.rse.files.ui/src
;../org.eclipse.rse.logging/src
;../org.eclipse.rse.processes.ui/src
;../org.eclipse.rse.services/src
;../org.eclipse.rse.services/clientserver
@ -90,8 +88,6 @@ org.eclipse.rse.files.ui.widgets
org.eclipse.rse.files.ui.wizards
org.eclipse.rse.filters
org.eclipse.rse.logging
org.eclipse.rse.logging.performance
org.eclipse.rse.logging.ui
org.eclipse.rse.model
org.eclipse.rse.persistence
org.eclipse.rse.persistence.dom

View file

@ -36,8 +36,6 @@
</topic>
<topic label="Logging" href="provisional_api.html">
<topic label="org.eclipse.rse.logging" href="reference/api/org/eclipse/rse/logging/package-summary.html"/>
<topic label="org.eclipse.rse.logging.ui" href="reference/api/org/eclipse/rse/logging/ui/package-summary.html"/>
<topic label="org.eclipse.rse.logging.performance" href="reference/api/org/eclipse/rse/logging/performance/package-summary.html"/>
</topic>
<topic label="Model and Persistence" href="provisional_api.html">
<topic label="org.eclipse.rse.core.model" href="reference/api/org/eclipse/rse/core/model/package-summary.html"/>

View file

@ -50,13 +50,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.rse.logging"
download-size="12"
install-size="28"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.rse.processes.ui"
download-size="22"

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1 +0,0 @@
bin

View file

@ -5,24 +5,7 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,70 +0,0 @@
#Tue Jan 30 22:33:44 CET 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
org.eclipse.jdt.core.compiler.compliance=1.4
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.3

View file

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006 IBM Corporation. All rights reserved.
This program and the accompanying materials are made available under the terms
of the Eclipse Public License v1.0 which accompanies this distribution, and is
available at http://www.eclipse.org/legal/epl-v10.html
Initial Contributors:
The following IBM employees contributed to the Remote System Explorer
component that contains this file: David McKnight, Kushal Munir,
Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
Contributors:
Michael Berger (IBM Canada) - 148434 Better user assistance for logging preference page.
-->
<?NLS TYPE="org.eclipse.help.contexts"?>
<contexts>
<!-- RSE logging -->
<context id="rsel0000">
<description>This page allows you to specify the Remote System Explorer logging preferences.
You can specify what severity of messages you wish to log - from informational messages, to warnings, to errors. If it is available, the debug setting provides the most detail.
Messages are logged to the .log file in the .metadata folder of the workspace.
</description>
</context>
</contexts>

View file

@ -1,15 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rse.logging;singleton:=true
Bundle-Version: 1.0.100.qualifier
Bundle-Activator: org.eclipse.rse.logging.RemoteSystemsLoggingPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Eclipse-LazyStart: true
Export-Package: org.eclipse.rse.internal.logging;x-internal:=true,
org.eclipse.rse.internal.logging.ui;x-internal:=true,
org.eclipse.rse.logging
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: J2SE-1.4

View file

@ -1,28 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>June 2, 2006</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
</body>
</html>

View file

@ -1,19 +0,0 @@
###############################################################################
# Copyright (c) 2001, 2006 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
bin.includes = HelpContexts.xml,\
plugin.properties,\
plugin.xml,\
style/,\
.,\
about.html,\
META-INF/
source.. = src/
output.. = bin/

View file

@ -0,0 +1,5 @@
This plugin has been decommissioned on 30-Mar-2007.
Its contents has been merged into org.eclipse.rse.core
and org.eclipse.rse.ui plugins, respectively.

View file

@ -1,25 +0,0 @@
################################################################################
# Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License v1.0 which accompanies this distribution, and is
# available at http://www.eclipse.org/legal/epl-v10.html
#
# Initial Contributors:
# The following IBM employees contributed to the Remote System Explorer
# component that contains this file: David McKnight, Kushal Munir,
# Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
#
# Contributors:
# Martin Oberhuber (Wind River) - removed obsolete property key
################################################################################
# =================================================
# Remote Systems logging plugin.xml properties file
# =================================================
# NLS_MESSAGEFORMAT_NONE
# NLS_ENCODING=UTF-8
pluginName = RSE Logging
providerName = Eclipse.org

View file

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006 IBM Corporation. All rights reserved.
This program and the accompanying materials are made available under the terms
of the Eclipse Public License v1.0 which accompanies this distribution, and is
available at http://www.eclipse.org/legal/epl-v10.html
Initial Contributors:
The following IBM employees contributed to the Remote System Explorer
component that contains this file: David McKnight, Kushal Munir,
Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
Contributors:
{Name} (company) - description of contribution.
-->
<?eclipse version="3.1"?>
<plugin>
<!-- ============================================ -->
<!-- Define Help Context -->
<!-- ============================================ -->
<extension point="org.eclipse.help.contexts">
<contexts
file="HelpContexts.xml">
</contexts>
</extension>
<!-- Preferences -->
<extension point="org.eclipse.core.runtime.preferences">
<initializer class="org.eclipse.rse.internal.logging.LoggingPreferenceInitializer"/>
</extension>
</plugin>

View file

@ -1,139 +0,0 @@
/********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.internal.logging;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Date;
import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
/**
* Log Listener is a sink for messages coming from Logger.
*/
public class LogListener implements ILogListener, IPropertyChangeListener {
private PrintWriter log = null;
private File outputFile = null;
/**
* Create a new log listener for a plugin.
* @param plugin The plugin for which to create a log listener.
*/
public LogListener(Plugin plugin) {
IPath path = plugin.getStateLocation().addTrailingSeparator().append(".log"); //$NON-NLS-1$
outputFile = path.toFile();
if ((outputFile != null) && (outputFile.exists())) {
outputFile.delete();
}
initialize();
}
/**
* Initialize the logger. Retrieves the logging location preference and sets up the logger
* to log to that location.
*/
private void initialize() {
try {
freeResources();
log = new PrintWriter(new BufferedWriter(new FileWriter(outputFile.toString(), true)), true);
} catch (Exception e) {
log = null;
System.err.println("Exception in RemoteSystemLogListener.initialize(): " + e.getMessage()); //$NON-NLS-1$
e.printStackTrace();
}
}
public void logging(IStatus status) {
if (log == null)
return;
else {
// Need a to string here, because we need to be able to compare dates.
String date = new Date().toString();
log.println(date);
int severity = status.getSeverity();
if (severity == IStatus.ERROR) {
log.print("ERROR"); //$NON-NLS-1$
} else if (severity == IStatus.WARNING) {
log.print("WARNING"); //$NON-NLS-1$
} else if (severity == IStatus.INFO) {
log.print("INFO"); //$NON-NLS-1$
} else if (severity == IStatus.OK) {
log.print("DEBUG"); //$NON-NLS-1$
}
log.print(" "); //$NON-NLS-1$
log.print(status.getPlugin());
log.print(" "); //$NON-NLS-1$
log.println(status.getMessage());
if (status.getException() != null) status.getException().printStackTrace(log);
if (status.isMultiStatus()) {
IStatus[] children = status.getChildren();
for (int i = 0; i < children.length; i++) {
loggingChild(children[i]);
}
}
log.println("--------------------------------------------"); //$NON-NLS-1$
}
}
public void logging(IStatus status, String plugin) {
logging(status);
}
/**
* @param tmp org.eclipse.core.runtime.IStatus
*/
private void loggingChild(IStatus status) {
if (log == null)
return;
else {
log.print("\t\t"); //$NON-NLS-1$
log.println(status.getMessage());
if (status.getException() != null) status.getException().printStackTrace(log);
if (status.isMultiStatus()) {
IStatus[] children = status.getChildren();
for (int i = 0; i < children.length; i++)
logging(children[i]);
}
}
}
/**
* Handle changes from Preferences page.
*/
public synchronized void propertyChange(PropertyChangeEvent event) {
// refresh the log location from plugin Preference store
initialize();
}
public void freeResources() {
if (log == null) return;
log.flush();
log.close();
log = null;
}
}

View file

@ -1,43 +0,0 @@
/********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.internal.logging;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.rse.logging.Logger;
import org.eclipse.rse.logging.RemoteSystemsLoggingPlugin;
/**
* This class initializes logging preferences.
*/
public class LoggingPreferenceInitializer extends AbstractPreferenceInitializer {
/**
* Constructor.
*/
public LoggingPreferenceInitializer() {
super();
}
/**
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
public void initializeDefaultPreferences() {
Preferences prefs = RemoteSystemsLoggingPlugin.getDefault().getPluginPreferences();
prefs.setDefault(Logger.DEBUG_LEVEL, Logger.LOG_ERROR);
}
}

View file

@ -1,29 +0,0 @@
/********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* David Dykstal (IBM) - 148434 Better F1 help.
********************************************************************************/
package org.eclipse.rse.internal.logging.ui;
import org.eclipse.osgi.util.NLS;
public class LoggingPreferenceLabels extends NLS {
private static String BUNDLE_NAME = "org.eclipse.rse.internal.logging.ui.LoggingPreferenceLabels";//$NON-NLS-1$
public static String LOGGING_PREFERENCE_PAGE_TOPLABEL;
public static String LOGGING_PREFERENCE_PAGE_ERRORS_ONLY;
public static String LOGGING_PREFERENCE_PAGE_WARNINGS_ERRORS;
public static String LOGGING_PREFERENCE_PAGE_INFO_DEBUG;
public static String LOGGING_PREFERENCE_PAGE_FULL_DEBUG;
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, LoggingPreferenceLabels.class);
}
}

View file

@ -1,29 +0,0 @@
################################################################################
# Copyright (c) 2006 IBM Corporation. All rights reserved.
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License v1.0 which accompanies this distribution, and is
# available at http://www.eclipse.org/legal/epl-v10.html
#
# Initial Contributors:
# The following IBM employees contributed to the Remote System Explorer
# component that contains this file: David McKnight, Kushal Munir,
# Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
#
# Contributors:
# {Name} (company) - description of contribution.
################################################################################
# =====================================
# Remote System Logging properties file
# =====================================
# NLS_MESSAGEFORMAT_VAR
# NLS_ENCODING=UTF-8
# Preference Page
# ----------------
LOGGING_PREFERENCE_PAGE_TOPLABEL = Logging Level
LOGGING_PREFERENCE_PAGE_ERRORS_ONLY = &Errors only
LOGGING_PREFERENCE_PAGE_WARNINGS_ERRORS = &Warnings and errors
LOGGING_PREFERENCE_PAGE_INFO_DEBUG = Warnings, errors and &information messages
LOGGING_PREFERENCE_PAGE_FULL_DEBUG = Full &debug

View file

@ -1,245 +0,0 @@
/********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* Michael Berger (IBM Canada) - 148434 Better F1 help.
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.internal.logging.ui;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.preference.PreferenceStore;
import org.eclipse.rse.logging.Logger;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
/**
* An abstract preference page for all remote system logging.<br/>
* Use a subclass of this page if you need a preference page to control
* logging.
*/
public abstract class LoggingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
private Button radioButton0;
private Button radioButton1;
private Button radioButton2;
private Button radioButton3;
/**
* Creates composite control and sets the default layout data.
*
* @param parent the parent of the new composite
* @param numColumns the number of columns for the new composite
* @return the newly-created coposite
*/
private Composite createComposite(Composite parent, int span, int numColumns) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = numColumns;
composite.setLayout(layout);
GridData data = new GridData();
data.verticalAlignment = GridData.FILL;
data.horizontalAlignment = GridData.FILL;
data.horizontalSpan = span;
composite.setLayoutData(data);
return composite;
}
/**
* Creates group control and sets the default layout data.
* @param parent the parent of the new composite
* @param numColumns the number of columns for the new composite
* @return the newly-created coposite
*/
private Group createGroup(Composite parent, int span, int numColumns, String text) {
Group group = new Group(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = numColumns;
group.setLayout(layout);
GridData data = new GridData();
data.verticalAlignment = GridData.FILL;
data.horizontalAlignment = GridData.FILL;
data.horizontalSpan = span;
group.setLayoutData(data);
group.setText(text);
return group;
}
/**
* Utility method that creates a radio button instance
* and sets the default layout data.
*
* @param parent the parent for the new button
* @param label the label for the new button
* @return the newly-created button
*/
private Button createRadioButton(Composite parent, String label) {
Button button = new Button(parent, SWT.RADIO | SWT.LEFT);
button.setText(label);
GridData data = new GridData();
button.setLayoutData(data);
return button;
}
/**
* Method declared on PreferencePage
*/
protected Control createContents(Composite parent) {
Composite composite_tab = createComposite(parent, 1, 1);
String topLabel = LoggingPreferenceLabels.LOGGING_PREFERENCE_PAGE_TOPLABEL;
Group group = createGroup(composite_tab, 1, 1, topLabel);
radioButton0 = createRadioButton(group, LoggingPreferenceLabels.LOGGING_PREFERENCE_PAGE_ERRORS_ONLY);
radioButton1 = createRadioButton(group, LoggingPreferenceLabels.LOGGING_PREFERENCE_PAGE_WARNINGS_ERRORS);
radioButton2 = createRadioButton(group, LoggingPreferenceLabels.LOGGING_PREFERENCE_PAGE_INFO_DEBUG);
if (Logger.DEBUG) {
radioButton3 = createRadioButton(group, LoggingPreferenceLabels.LOGGING_PREFERENCE_PAGE_FULL_DEBUG);
}
initializeValues();
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.eclipse.rse.logging.rsel0000"); //$NON-NLS-1$
return composite_tab;
}
/**
*
*/
protected IPreferenceStore doGetPreferenceStore() {
Bundle bundle = getBundle();
if (bundle != null) {
AbstractUIPlugin plugin = getPlugin();
if (plugin != null) {
return plugin.getPreferenceStore();
} else {
return new PreferenceStore();
}
} else {
return new PreferenceStore();
}
}
protected abstract AbstractUIPlugin getPlugin();
private Bundle getBundle() {
Plugin plugin = getPlugin();
Bundle bundle = plugin.getBundle();
return bundle;
}
/**
* Method declared on IWorkbenchPreferencePage
*/
public void init(IWorkbench workbench) {
}
/**
* Initializes states of the controls using current values
* in the preference store.
*/
private void initializeValues() {
IPreferenceStore store = getPreferenceStore();
radioButton0.setSelection(false);
radioButton1.setSelection(false);
radioButton2.setSelection(false);
if (null != radioButton3) radioButton3.setSelection(false);
int choice = store.getInt(Logger.DEBUG_LEVEL);
switch (choice) {
case 0:
radioButton0.setSelection(true);
break;
case 1:
radioButton1.setSelection(true);
break;
case 2:
radioButton2.setSelection(true);
break;
case 3:
if (null != radioButton3)
radioButton3.setSelection(true);
else
radioButton2.setSelection(true);
break;
}
}
/**
* Initializes states of the controls using default values
* in the preference store.
*/
private void initializeDefaults() {
IPreferenceStore store = getPreferenceStore();
radioButton0.setSelection(false);
radioButton1.setSelection(false);
radioButton2.setSelection(false);
if (null != radioButton3) radioButton3.setSelection(false);
int choice = store.getDefaultInt(Logger.DEBUG_LEVEL);
switch (choice) {
case 0:
radioButton0.setSelection(true);
break;
case 1:
radioButton1.setSelection(true);
break;
case 2:
radioButton2.setSelection(true);
break;
case 3:
if (null != radioButton3)
radioButton3.setSelection(true);
else
radioButton2.setSelection(true);
break;
}
}
/**
* Method declared on PreferencePage
*/
protected void performDefaults() {
super.performDefaults();
initializeDefaults();
}
/**
* Method declared on PreferencePage
*/
public boolean performOk() {
storeValues();
return true;
}
/**
* Stores the values of the controls back to the preference store.
*/
private void storeValues() {
IPreferenceStore store = getPreferenceStore();
int choice = 0;
if (radioButton1.getSelection())
choice = 1;
else if (radioButton2.getSelection())
choice = 2;
else if (null != radioButton3 && radioButton3.getSelection()) choice = 3;
store.setValue(Logger.DEBUG_LEVEL, choice);
}
}

View file

@ -1,250 +0,0 @@
/********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.logging;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
import org.eclipse.rse.internal.logging.LogListener;
/**
* Generic Logger class for handling Remote Systems logging and tracing.<br>
* <br>
* The debug level is determined by a "debug_level" key in the preferences store
* of the plugin that owns this Logger instance.<br>
* <br>
* The debug location is determined by a "log_location" key in the preferences store
* of the plugin that owns this Logger instance.<br>
* <br>
* The valid values for these keys can be found in the javadocs for IRemoteSystemsLogging.<br>.
* This means that these keys could have been defined through hardcoding in your
* plugin startup code, through preferences.ini in the plugin install directory,
* OR from pref_store.ini in the plugin read/write metadata area. <br>
* The default behavior is to log to file, and to log only errors.
* <br>
* A typical usage of this class is as follows: <br>
* <br>
* public class myPlugin extends AbstractUIPlugin { <br>
* <br>
* // a cached Logger inst for convenience.<br>
* public static Logger out = null;<br>
* <br>
* public myPlugin(IPluginDescriptor descriptor) { <br>
* super(descriptor);<br>
* ......<br>
* ......<br>
* out = LoggerFactory.getInst(this);<br>
* out.logInfo("loading myPlugin class.");<br>
* //out.logWarning("This is a warning message.");<br>
* //out.logError("This is an error.", new Exception());<br>
* //out.logDebugMessage(<br>
* // "myPlugin",<br>
* // "this is a debug message from class myPlugin.");<br>
* ......<br>
* ......<br>
* }<br>
* <br>
* <br>
* public void shutdown() throws CoreException {<br>
* super.shutdown();<br>
* LoggerFactory.freeInst(this);<br>
* }<br>
* <br>
*
*/
public class Logger implements IPropertyChangeListener {
/**
* Constant can be used to surround debugging code. Optimizing
* compilers have the possibility of removing the code from
* a production copy.
*
* Should be set false normally. Only set to true when testing.
*/
public static final boolean DEBUG = false;
/**
* Name of the key that controls the logging level.<br>
* (value is "debug_level").
*/
public static final String DEBUG_LEVEL = "debug_level"; //$NON-NLS-1$
/**
* Set debug_level to this value to get Error messages.<br>
* (value is 0).
*/
public static final int LOG_ERROR = 0;
/**
* Set debug_level to this value to get Warning messages.<br>
* (value is 1).
*/
public static final int LOG_WARNING = 1;
/**
* Set debug_level to this value to get Information messages.<br>
* (value is 2).
*/
public static final int LOG_INFO = 2;
/**
* Set debug_level to this value to get Debug messages.<br>
* (value is 3).
*/
public static final int LOG_DEBUG = 3;
private ILog systemsPluginLog = null;
private LogListener logListener = null;
private String pluginId = null;
private Plugin systemPlugin = null;
private int debug_level = Logger.LOG_ERROR;
/**
* Creates a new Logger. Invoked by the LoggerFactory.
* @param systemPlugin The preferences for this plugin will determine the detail
* logged by this logger. This allows different levels of detail to be logged in the
* workbench.
* @see LoggerFactory#getLogger(Plugin)
*/
Logger(Plugin systemPlugin) {
this.systemPlugin = systemPlugin;
this.pluginId = systemPlugin.getBundle().getSymbolicName();
initialize();
}
public synchronized void freeResources() {
logListener.freeResources();
}
public synchronized int getDebugLevel() {
return debug_level;
}
/**
* Log a Debug message. This is intended to be used as follows:<br>
* Logger.logDebugMessage("someClassName", "someMessage");<br>
* <br>
* and the output will be:<br>
* <br>
* ---------------------------------------------------------------<br>
* DEBUG org.eclipse.rse.logging someClassName<br>
* someMessage<br>
* ---------------------------------------------------------------<br>
* <br>
* <br>
* Note that since this message is only for developer debugging, it does not
* need to be localized to proper local.<br>
*/
public synchronized void logDebugMessage(String className, String message) {
if (Logger.DEBUG && debug_level >= Logger.LOG_DEBUG) {
MultiStatus debugStatus = new MultiStatus(pluginId, IStatus.OK, className, null);
Status infoStatus = new Status(IStatus.OK, pluginId, IStatus.OK, message, null);
debugStatus.add(infoStatus);
systemsPluginLog.log(debugStatus);
}
}
/**
* Log an Error message with an exception. Note that the message should already
* be localized to proper locale.
* @param message the message to log.
* @param ex the exception that caused the condition, may be null.
*/
public synchronized void logError(String message, Throwable ex) {
if (debug_level >= Logger.LOG_ERROR) {
if (message == null) message = ""; //$NON-NLS-1$
Status errorStatus = new Status(IStatus.ERROR, pluginId, IStatus.OK, message, ex);
systemsPluginLog.log(errorStatus);
}
}
/**
* Log an Information message. Note that the message should already
* be localized to proper local.<br>
* ie: Resource.getString() should already have been called
*/
public synchronized void logInfo(String message) {
logInfo(message, null);
}
/**
* Log an Information message. Note that the message should already
* be localized to proper local.<br>
* ie: Resource.getString() should already have been called
*/
public synchronized void logInfo(String message, Throwable ex) {
if (debug_level >= Logger.LOG_INFO) {
if (message == null) message = ""; //$NON-NLS-1$
Status infoStatus = new Status(IStatus.INFO, pluginId, IStatus.OK, message, ex);
systemsPluginLog.log(infoStatus);
}
}
/**
* Log a Warning message. Note that the message should already
* be localized to proper local.<br>
* ie: Resource.getString() should already have been called
*/
public synchronized void logWarning(String message) {
logWarning(message, null);
}
/**
* Log a Warning message. Note that the message should already
* be localized to proper local.<br>
* ie: Resource.getString() should already have been called
*/
public synchronized void logWarning(String message, Throwable ex) {
if (debug_level >= Logger.LOG_WARNING) {
if (message == null) message = ""; //$NON-NLS-1$
Status warningStatus = new Status(IStatus.WARNING, pluginId, IStatus.OK, message, ex);
systemsPluginLog.log(warningStatus);
}
}
/**
* Handle changes from a Preferences page.
*/
public synchronized void propertyChange(PropertyChangeEvent event) {
Preferences prefs = systemPlugin.getPluginPreferences();
debug_level = prefs.getInt(Logger.DEBUG_LEVEL);
}
public synchronized void setDebugLevel(int level) {
debug_level = level;
}
/**
* Initialize the Logger. The logger uses an ILog from the platform for this particular plugin, and
* establishes a listener on that log to format the items placed in the log.
*/
private void initialize() {
systemsPluginLog = systemPlugin.getLog();
logListener = new LogListener(systemPlugin);
systemsPluginLog.addLogListener(logListener);
Preferences store = systemPlugin.getPluginPreferences();
debug_level = store.getInt(Logger.DEBUG_LEVEL);
store.addPropertyChangeListener(this);
store.addPropertyChangeListener(logListener);
}
}

View file

@ -1,61 +0,0 @@
/********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.logging;
import java.util.Hashtable;
import org.eclipse.core.runtime.Plugin;
/**
* Factory class for creating Logger instances.<br>
* Keep in mind that this factory class follows the singleton model.<br>
* ie: once an instance of a Logger class for a given plugin is created,
* it will always be reused.
*/
public class LoggerFactory {
private static Hashtable pluginTable = new Hashtable();
/**
* Returns the Logger instance for a given plugin. There is only
* one instance of the Logger class per plugin.
* @param plugin the plugin for which to find or create the log
* @return the logger for that plugin
*/
public static Logger getLogger(Plugin plugin) {
Logger logger = (Logger) pluginTable.get(plugin);
if (logger == null) {
logger = new Logger(plugin);
pluginTable.put(plugin, logger);
}
return logger;
}
/**
* Frees resources used by the Logger instance for the given plugin.
* This method must be called as part of the the plugin shutdown life cycle.
* @param plugin the plugin for which to free logging resources
*/
public static void freeLogger(Plugin plugin) {
Logger logger = (Logger) pluginTable.get(plugin);
if (logger != null) {
logger.freeResources();
pluginTable.remove(plugin);
}
}
}

View file

@ -1,57 +0,0 @@
/********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.logging;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* Remote Systems Logging plugin.
*/
public class RemoteSystemsLoggingPlugin extends Plugin {
private static RemoteSystemsLoggingPlugin singleton;
/**
* Constructor.
*/
public RemoteSystemsLoggingPlugin() {
super();
singleton = this;
}
/**
* Returns the shared plugin instance.
*/
public static RemoteSystemsLoggingPlugin getDefault() {
return singleton;
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
}
}

View file

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:xalan="http://xml.apache.org/xslt">
<xsl:template match="/Benchmark">
<html>
<body>
<h2><xsl:value-of select="@BenchmarkID"/></h2>
<p>
<xsl:for-each select="System">
Operating system: <xsl:value-of select="@OSName"/><br />
</xsl:for-each>
<xsl:for-each select="_NORMALIZATION_VALUES">
Normalization value: <xsl:value-of select="@ElapsedTime"/>
</xsl:for-each>
</p>
<table border="1">
<tr>
<th>CallerID</th>
<th>ElapsedTime</th>
<th>NormalizedFactor</th>
</tr>
<xsl:for-each select="Task">
<tr>
<td><xsl:value-of select="@CallerID"/></td>
<td><xsl:value-of select="@ElapsedTime"/></td>
<td><xsl:value-of select="@NormalizedFactor"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>