1 /*******************************************************************************
2 * Copyright (c) 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 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.gdbtrace
.core
;
15 import org
.eclipse
.core
.runtime
.IStatus
;
16 import org
.eclipse
.core
.runtime
.Plugin
;
17 import org
.eclipse
.core
.runtime
.Status
;
20 * The activator class controls the plug-in life cycle. No more than one such
21 * plug-in can exist at any time.
23 * It also provides the plug-in's general logging facility and manages the
26 public class Activator
extends Plugin
{
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
35 public static final String PLUGIN_ID
= "org.eclipse.linuxtools.gdbtrace.core"; //$NON-NLS-1$
40 private static Activator fPlugin
;
42 // ------------------------------------------------------------------------
44 // ------------------------------------------------------------------------
53 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
58 * Returns the TMF Core plug-in instance.
60 * @return the TMF Core plug-in instance.
62 public static Activator
getDefault() {
66 // Sets plug-in instance
67 private static void setDefault(Activator plugin
) {
71 // ------------------------------------------------------------------------
73 // ------------------------------------------------------------------------
76 * Logs a message with severity INFO in the runtime log of the plug-in.
78 * @param message A message to log
80 public static void logInfo(String message
) {
81 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
85 * Logs a message and exception with severity INFO in the runtime log of the plug-in.
87 * @param message A message to log
88 * @param exception The corresponding exception
90 public static void logInfo(String message
, Throwable exception
) {
91 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
94 // ------------------------------------------------------------------------
96 // ------------------------------------------------------------------------
99 * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
101 * @param message A message to log
103 public static void logWarning(String message
) {
104 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
108 * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
110 * @param message A message to log
111 * @param exception The corresponding exception
113 public static void logWarning(String message
, Throwable exception
) {
114 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
117 // ------------------------------------------------------------------------
119 // ------------------------------------------------------------------------
122 * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
124 * @param message A message to log
126 public static void logError(String message
) {
127 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
131 * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
133 * @param message A message to log
134 * @param exception The corresponding exception
136 public static void logError(String message
, Throwable exception
) {
137 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.032887 seconds and 5 git commands to generate.