/*******************************************************************************
 * Copyright (C) 2011, Google Inc.
 *
 * 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
 *******************************************************************************/
package com.google.eclipse.mechanic.plugin.core;

import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;

/**
 * Abstraction on top of {@link ILog}.
 */
public class MechanicLog {
  private static final MechanicLog DEFAULT = new MechanicLog(MechanicPlugin.getDefault());

  private final ILog log;

  /**
   * Get the default instance.
   */
  public static MechanicLog getDefault() {
    return DEFAULT;
  }

  MechanicLog(Plugin plugin) {
    log = plugin.getLog();
  }

  /**
   * Log a status.
   */
  public void log(IStatus status) {
    log.log(status);
  }

  /**
   * Log an error to the Eclipse log.
   *
   * @param t the throwable.
   * @param fmt string format
   * @param args args that accompany the string format. If this is empty, fmt is assumed to be
   * an unformatted string.
   */
  public void logError(Throwable t, String fmt, Object... args) {
    String text = (args.length > 0) ? String.format(fmt, args) : fmt;
    log(new Status(IStatus.ERROR, MechanicPlugin.PLUGIN_ID, text, t));
  }

  /**
   * Log an error to the Eclipse log, using the exception's message as the log message text.
   *
   * @param t the throwable.
   */
  public void logError(Throwable t) {
    logError(t, t.getMessage());
  }

  /**
   * Log info to the Eclipse log.
   *
   * @param t the throwable.
   * @param fmt string format
   * @param args args that accompany the string format. If this is empty, fmt is assumed to be
   * an unformatted string.
   */
  public void logInfo(String fmt, Object... args) {
    String text = (args.length > 0) ? String.format(fmt, args) : fmt;
    log(new Status(IStatus.INFO, MechanicPlugin.PLUGIN_ID, text));
  }
}

@@ -1827,39 +1827,695 @@
    * @param 
-t the throwable
+fmt string format%0A   * @param args args that accompany the string format. If this is empty, fmt is assumed to be%0A   * an unformatted string.%0A   */%0A  public void logInfo(String fmt, Object... args) %7B%0A    log(IStatus.INFO, fmt, args);%0A  %7D%0A%0A  /**%0A   * Log warning to the Eclipse log.%0A   *%0A   * @param fmt string format%0A   * @param args args that accompany the string format. If this is empty, fmt is assumed to be%0A   * an unformatted string.%0A   */%0A  public void logWarning(String fmt, Object... args) %7B%0A    log(IStatus.WARNING, fmt, args);%0A  %7D%0A%0A%0A  /**%0A   * Log a message to the Eclipse log.%0A   *%0A   * @param severity message severity. Reference %7B@link IStatus#getSeverity()%7D
 .%0A   * @para
@@ -2672,37 +2672,47 @@
  public void log
-Info(
+(int severity, 
 String fmt, Obje
@@ -2814,28 +2814,24 @@
  Status(
-IStatus.INFO
+severity
 , Mechan

add logWarning and general severity-based log