エラーログの制御
Eclipseにはエラー・ログビューがありますが、エラー・ログビューの使い方です。
このビューにエラー内容を表示するには以下の記述をすればよいようです。
IStatus status = new Status(IStatus.ERROR, SamplePlugin .getPluginId(), IStatus.OK, "メッセージ", new Exception("エラーメッセージ")); SamplePlugin.getDefault().getLog().log(status);
Statusオブジェクトはエラーなどの状況を格納したクラスです。コンストラクタの引数の意味は以下の通り。
/** * Creates a new status object. The created status has no children. * * @param severity the severity; one of <code>OK</code>, <code>ERROR</code>, * <code>INFO</code>, <code>WARNING</code>, or <code>CANCEL</code> * @param pluginId the unique identifier of the relevant plug-in * @param code the plug-in-specific status code, or <code>OK</code> * @param message a human-readable message, localized to the * current locale * @param exception a low-level exception, or <code>null</code> if not * applicable */
このビューは
という項目があります。
この記事は
現在のアクセス:17649