📄 logutil.java
字号:
/*******************************************************************************
* Copyright (c) 2007 Siemens AG, KolbW@re
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Bernd Kolb - initial API and implementation
* Kai T鰀ter - integration
*******************************************************************************/
package com.siemens.ct.mp3m.utilities;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
/**
* A Utility class for logging
*/
public class LogUtil {
public static void logError(String bundleID, Throwable t) {
logError(bundleID, t.getMessage(), t);
}
public static void logError(String bundleID, String message, Throwable t) {
log(bundleID, message, t, Status.ERROR, Status.OK);
}
public static void logError(String bundleID, String message) {
logError(bundleID, message, null);
}
public static void log(String bundleID, String message, Throwable t, int serverity, int code) {
if (bundleID == null) {
bundleID = Activator.getDefault().getBundle().getSymbolicName();
}
Platform.getLog(Platform.getBundle(bundleID)).log(
new Status(serverity, bundleID, code, message, t));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -