1 /*******************************************************************************
2 * Copyright (c) 2009, 2013 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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.tmf
.core
;
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
{
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
36 public static final String PLUGIN_ID
= "org.eclipse.linuxtools.tmf.core"; //$NON-NLS-1$
41 private static Activator fPlugin
;
43 // ------------------------------------------------------------------------
45 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 * Returns the TMF Core plug-in instance.
61 * @return the TMF Core plug-in instance.
63 public static Activator
getDefault() {
67 // Sets plug-in instance
68 private static void setDefault(Activator plugin
) {
72 // ------------------------------------------------------------------------
74 // ------------------------------------------------------------------------
77 public void start(BundleContext context
) throws Exception
{
84 public void stop(BundleContext context
) throws Exception
{
90 // ------------------------------------------------------------------------
92 // ------------------------------------------------------------------------
95 * Logs a message with severity INFO in the runtime log of the plug-in.
100 public static void logInfo(String message
) {
101 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
105 * Logs a message and exception with severity INFO in the runtime log of the
111 * The corresponding exception
113 public static void logInfo(String message
, Throwable exception
) {
114 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
117 // ------------------------------------------------------------------------
119 // ------------------------------------------------------------------------
122 * Logs a message and exception with severity WARNING in the runtime log of
128 public static void logWarning(String message
) {
129 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
133 * Logs a message and exception with severity WARNING in the runtime log of
139 * The corresponding exception
141 public static void logWarning(String message
, Throwable exception
) {
142 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
145 // ------------------------------------------------------------------------
147 // ------------------------------------------------------------------------
150 * Logs a message and exception with severity ERROR in the runtime log of
156 public static void logError(String message
) {
157 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
161 * Logs a message and exception with severity ERROR in the runtime log of
167 * The corresponding exception
169 public static void logError(String message
, Throwable exception
) {
170 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.034284 seconds and 5 git commands to generate.