0fa9eaff54b8ee9e72fbb0ccfed27d7200cec943
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
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfTraceManager
;
19 import org
.osgi
.framework
.BundleContext
;
22 * The activator class controls the plug-in life cycle. No more than one such
23 * plug-in can exist at any time.
25 * It also provides the plug-in's general logging facility and manages the
28 public class Activator
extends Plugin
{
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
37 public static final String PLUGIN_ID
= "org.eclipse.linuxtools.tmf.core"; //$NON-NLS-1$
42 private static Activator fPlugin
;
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
57 // ------------------------------------------------------------------------
60 * Returns the TMF Core plug-in instance.
62 * @return the TMF Core plug-in instance.
64 public static Activator
getDefault() {
68 // Sets plug-in instance
69 private static void setDefault(Activator plugin
) {
73 // ------------------------------------------------------------------------
75 // ------------------------------------------------------------------------
78 public void start(BundleContext context
) throws Exception
{
82 /* Initialize the trace manager */
83 TmfTraceManager
.getInstance();
87 public void stop(BundleContext context
) throws Exception
{
94 // ------------------------------------------------------------------------
96 // ------------------------------------------------------------------------
99 * Log an IStatus object directly
104 public static void log(IStatus status
) {
105 fPlugin
.getLog().log(status
);
108 // ------------------------------------------------------------------------
110 // ------------------------------------------------------------------------
113 * Logs a message with severity INFO in the runtime log of the plug-in.
118 public static void logInfo(String message
) {
119 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
123 * Logs a message and exception with severity INFO in the runtime log of the
129 * The corresponding exception
131 public static void logInfo(String message
, Throwable exception
) {
132 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
135 // ------------------------------------------------------------------------
137 // ------------------------------------------------------------------------
140 * Logs a message and exception with severity WARNING in the runtime log of
146 public static void logWarning(String message
) {
147 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
151 * Logs a message and exception with severity WARNING in the runtime log of
157 * The corresponding exception
159 public static void logWarning(String message
, Throwable exception
) {
160 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
163 // ------------------------------------------------------------------------
165 // ------------------------------------------------------------------------
168 * Logs a message and exception with severity ERROR in the runtime log of
174 public static void logError(String message
) {
175 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
179 * Logs a message and exception with severity ERROR in the runtime log of
185 * The corresponding exception
187 public static void logError(String message
, Throwable exception
) {
188 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.034149 seconds and 5 git commands to generate.