1 /*******************************************************************************
2 * Copyright (c) 2014, 2015 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 * Matthew Khouzam - Initial implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.btf
.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.tracecompass.btf.core"; //$NON-NLS-1$
41 private static Activator fPlugin
;
43 // ------------------------------------------------------------------------
45 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 * Returns the BTF plug-in instance.
61 * @return the BTF 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
{
83 public void stop(BundleContext context
) throws Exception
{
89 // ------------------------------------------------------------------------
91 // ------------------------------------------------------------------------
94 * Log an IStatus object directly
99 public static void log(IStatus status
) {
100 fPlugin
.getLog().log(status
);
103 // ------------------------------------------------------------------------
105 // ------------------------------------------------------------------------
108 * Logs a message with severity INFO in the runtime log of the plug-in.
113 public static void logInfo(String message
) {
114 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
118 * Logs a message and exception with severity INFO in the runtime log of the
124 * The corresponding exception
126 public static void logInfo(String message
, Throwable exception
) {
127 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
130 // ------------------------------------------------------------------------
132 // ------------------------------------------------------------------------
135 * Logs a message and exception with severity WARNING in the runtime log of
141 public static void logWarning(String message
) {
142 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
146 * Logs a message and exception with severity WARNING in the runtime log of
152 * The corresponding exception
154 public static void logWarning(String message
, Throwable exception
) {
155 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
158 // ------------------------------------------------------------------------
160 // ------------------------------------------------------------------------
163 * Logs a message and exception with severity ERROR in the runtime log of
169 public static void logError(String message
) {
170 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
174 * Logs a message and exception with severity ERROR in the runtime log of
180 * The corresponding exception
182 public static void logError(String message
, Throwable exception
) {
183 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.039109 seconds and 5 git commands to generate.