1
/*******************************************************************************
2
* Copyright (c) 2014 Ericsson
4
* All rights reserved. This program and the accompanying materials are
5
* made available under the terms of the Eclipse Public License v1.0 which
6
* accompanies this distribution, and is available at
7
* http://www.eclipse.org/legal/epl-v10.html
10
* Marc-Andre Laperle - Initial implementation
11
*******************************************************************************/
13
package org.eclipse.linuxtools.lttng.alltests;
15
import org.eclipse.core.runtime.IStatus;
16
import org.eclipse.core.runtime.Plugin;
17
import org.eclipse.core.runtime.Status;
18
import org.osgi.framework.BundleContext;
21
* The activator class controls the plug-in life cycle. No more than one such
22
* plug-in can exist at any time.
24
* It also provides the plug-in's general logging facility and manages the
27
public class Activator extends Plugin {
32
public static final String PLUGIN_ID = "org.eclipse.linuxtools.lttng.alltests"; //$NON-NLS-1$
37
private static Activator fPlugin;
46
// ------------------------------------------------------------------------
48
// ------------------------------------------------------------------------
51
* Returns the AllTests plug-in instance.
53
* @return the AllTests plug-in instance.
55
public static Activator getDefault() {
59
// Sets plug-in instance
60
private static void setDefault(Activator plugin) {
64
// ------------------------------------------------------------------------
66
// ------------------------------------------------------------------------
69
public void start(BundleContext context) throws Exception {
75
public void stop(BundleContext context) throws Exception {
82
* Log an IStatus object directly
87
public static void log(IStatus status) {
88
fPlugin.getLog().log(status);
91
// ------------------------------------------------------------------------
93
// ------------------------------------------------------------------------
96
* Logs a message with severity INFO in the runtime log of the plug-in.
101
public static void logInfo(String message) {
102
fPlugin.getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
106
* Logs a message and exception with severity INFO in the runtime log of the
112
* The corresponding exception
114
public static void logInfo(String message, Throwable exception) {
115
fPlugin.getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message, exception));
118
// ------------------------------------------------------------------------
120
// ------------------------------------------------------------------------
123
* Logs a message and exception with severity WARNING in the runtime log of
129
public static void logWarning(String message) {
130
fPlugin.getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message));
134
* Logs a message and exception with severity WARNING in the runtime log of
140
* The corresponding exception
142
public static void logWarning(String message, Throwable exception) {
143
fPlugin.getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message, exception));
146
// ------------------------------------------------------------------------
148
// ------------------------------------------------------------------------
151
* Logs a message and exception with severity ERROR in the runtime log of
157
public static void logError(String message) {
158
fPlugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
162
* Logs a message and exception with severity ERROR in the runtime log of
168
* The corresponding exception
170
public static void logError(String message, Throwable exception) {
171
fPlugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));