PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/eclipse-plugin/plugins/com.google.test.metric.eclipse.core/src/main/java/com/google/test/metric/eclipse/internal/util/Logger.java

http://testability-explorer.googlecode.com/
Java | 39 lines | 12 code | 4 blank | 23 comment | 0 complexity | d9e49c18b8b12ccc262645801542cabc MD5 | raw file
 1/*
 2 * Copyright 2009 Google Inc.
 3 * 
 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 5 * use this file except in compliance with the License. You may obtain a copy of
 6 * the License at
 7 * 
 8 * http://www.apache.org/licenses/LICENSE-2.0
 9 * 
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16package com.google.test.metric.eclipse.internal.util;
17
18import com.google.test.metric.eclipse.core.plugin.Activator;
19
20import org.eclipse.core.runtime.Status;
21
22/**
23 * Utility class providing integration with Eclipse's logging framework.
24 * <p>
25 * Exceptions logged this way will show up in the Error log view.
26 * 
27 * @author klundberg@google.com (Karin Lundberg)
28 * 
29 */
30public class Logger {
31  public void logException(String msg, Throwable e) {
32    Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, msg, e));
33  }
34
35  public void logException(Throwable e) {
36    Activator.getDefault().getLog().log(
37        new Status(Status.ERROR, Activator.PLUGIN_ID, e.getMessage(), e));
38  }
39}