All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yworks.yshrink.ant.AntLogger Maven / Gradle / Ivy

Go to download

The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts

There is a newer version: 4.1.1
Show newest version
package com.yworks.yshrink.ant;

import com.yworks.yshrink.util.Logger;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;

/**
 * @author Michael Schroeder, yWorks GmbH http://www.yworks.com
 */
public class AntLogger extends Logger {

  private final Task task;
  private final Project project;

  public AntLogger( final Project project, final Task task ) {
    this.project = project;
    this.task = task;
    register();
  }

  public void doLog( final String s ) {
    project.log( task, s, Project.MSG_INFO );
  }

  public void doErr( final String s ) {
    project.log( task, "ERROR: "+s, Project.MSG_ERR );
  }

  public void doWarn( String s ) {
    //project.log( task, "WARNING: "+s, Project.MSG_WARN );
  }

  public void doWarnToLog( String s ) {
  }

  public void doShrinkLog( String s ) {
//    project.log( s, Project.MSG_INFO );
  }

  public void doErr( String s, Throwable ex ) {
    project.log( task, "ERROR: "+s + "\n" + ex.getMessage(), Project.MSG_ERR );
  }

  public void doShrinkLog( String s, Logger.ShrinkType type ) {
  }

  public void close() {
    unregister();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy