lmandel | 3c550af | 2005-06-16 05:46:02 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
amywu | ecebb04 | 2007-04-10 20:07:35 +0000 | [diff] [blame] | 2 | * Copyright (c) 2001, 2005 IBM Corporation and others. |
lmandel | 3c550af | 2005-06-16 05:46:02 +0000 | [diff] [blame] | 3 | * All rights reserved. This program and the accompanying materials |
| 4 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | * which accompanies this distribution, and is available at |
| 6 | * http://www.eclipse.org/legal/epl-v10.html |
amywu | ecebb04 | 2007-04-10 20:07:35 +0000 | [diff] [blame] | 7 | * |
lmandel | 3c550af | 2005-06-16 05:46:02 +0000 | [diff] [blame] | 8 | * Contributors: |
| 9 | * IBM Corporation - initial API and implementation |
| 10 | *******************************************************************************/ |
| 11 | |
| 12 | package org.eclipse.wst.xml.core.internal.validation.core.logging; |
| 13 | |
| 14 | import org.eclipse.core.runtime.IStatus; |
| 15 | import org.eclipse.core.runtime.Status; |
| 16 | import org.eclipse.wst.xml.core.internal.XMLCorePlugin; |
| 17 | |
| 18 | |
| 19 | /** |
| 20 | * A logger that will log to the log file in the eclipse metadata directory. |
| 21 | */ |
| 22 | public class EclipseLogger implements ILogger |
| 23 | { |
| 24 | |
| 25 | public void logError(String error, Throwable exception) |
| 26 | { |
| 27 | XMLCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, error, exception)); |
| 28 | } |
| 29 | |
| 30 | public void logWarning(String warning, Throwable exception) |
| 31 | { |
| 32 | XMLCorePlugin.getDefault().getLog().log(new Status(IStatus.WARNING, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.WARNING, warning, exception)); |
| 33 | } |
| 34 | } |