Package com.google.gwt.dev.util.log

Examples of com.google.gwt.dev.util.log.PrintWriterTreeLogger


      }
    };
  }

  private static TreeLogger createLogger() {
    PrintWriterTreeLogger logger = new PrintWriterTreeLogger(new PrintWriter(System.err, true));
    logger.setMaxDetail(TreeLogger.ERROR);
    return logger;
  }
View Full Code Here


  /**
   * @return a console-based logger.
   */
  protected final TreeLogger getConsoleLogger() {
    if (consoleLogger == null) {
      consoleLogger = new PrintWriterTreeLogger();
      consoleLogger.setMaxDetail(getLogLevel());
    }
    return consoleLogger;
  }
View Full Code Here

    } else {
      // Compile tasks without -treeLogger should run headless.
      if (System.getProperty("java.awt.headless") == null) {
        System.setProperty("java.awt.headless", "true");
      }
      PrintWriterTreeLogger logger = new PrintWriterTreeLogger();
      logger.setMaxDetail(options.getLogLevel());
      return doRun(logger, task);
    }
  }
View Full Code Here

  }

  public static void main(String[] args) {
    final CompileServerOptions options = new CompileServerOptionsImpl();
    if (new ArgProcessor(options).processArgs(args)) {
      PrintWriterTreeLogger logger = new PrintWriterTreeLogger();
      logger.setMaxDetail(options.getLogLevel());
      if (run(options, logger)) {
        System.exit(0);
      }
    }
    System.exit(-1);
View Full Code Here

    AbstractTreeLogger uiLogger = new SwingTreeLogger(this);
    uiLogger.setMaxDetail(maxLevel);
    TreeLogger bestLogger = uiLogger;
    if (logFile != null) {
      try {
        PrintWriterTreeLogger fileLogger = new PrintWriterTreeLogger(logFile);
        fileLogger.setMaxDetail(maxLevel);
        bestLogger = new CompositeTreeLogger(bestLogger, fileLogger);
      } catch (IOException ex) {
        bestLogger.log(TreeLogger.ERROR, "Can't log to file "
            + logFile.getAbsolutePath(), ex);
      }
View Full Code Here

  }

  private void logReachableTypes(TreeLogger logger) {
    if (logOutputWriter != null) {
      // Route the TreeLogger output to an output stream.
      PrintWriterTreeLogger printWriterTreeLogger = new PrintWriterTreeLogger(
          logOutputWriter);
      printWriterTreeLogger.setMaxDetail(TreeLogger.ALL);
      logger = printWriterTreeLogger;
    }

    logger.log(TreeLogger.DEBUG, "Reachable types computed on: "
        + new Date().toString());
View Full Code Here

  static final String BUNDLE_MIME_TYPE = "image/png";
  private static final int IMAGE_MAX_SIZE = Integer.getInteger(
      "gwt.imageResource.maxBundleSize", 256);

  public static void main(String[] args) {
    final TreeLogger logger = new PrintWriterTreeLogger(new PrintWriter(
        System.out));
    if (args.length < 2) {
      logger.log(TreeLogger.ERROR, ImageBundleBuilder.class.getSimpleName()
          + " <output file> <input file> ...");
      System.exit(-1);
    }

    ImageBundleBuilder builder = new ImageBundleBuilder();
    boolean fail = false;
    for (int i = 1, j = args.length; i < j; i++) {
      TreeLogger loopLogger = logger.branch(TreeLogger.DEBUG,
          "Processing argument " + args[i]);
      File file = new File(args[i]);

      Exception ex = null;
      try {
        builder.assimilate(loopLogger, args[i], file.toURL());
      } catch (MalformedURLException e) {
        ex = e;
      } catch (UnableToCompleteException e) {
        ex = e;
      } catch (UnsuitableForStripException e) {
        ex = e;
      }
      if (ex != null) {
        loopLogger.log(TreeLogger.ERROR, "Unable to assimilate image", ex);
        fail = true;
      }
    }

    if (fail) {
      System.exit(-1);
    }

    final String outFile = args[0];
    try {
      BufferedImage bundledImage = builder.drawBundledImage(new BestFitArranger());
      byte[] bytes = createImageBytes(logger, bundledImage);

      FileOutputStream out = new FileOutputStream(outFile);
      out.write(bytes);
      out.close();
    } catch (IOException e) {
      logger.log(TreeLogger.ERROR, "Unable to write output file", e);
      System.exit(-2);
    } catch (UnableToCompleteException e) {
      logger.log(TreeLogger.ERROR, "Unable to draw output image", e);
      System.exit(-2);
    }

    System.exit(0);
  }
View Full Code Here

  public TreeLogger createLogger(PrintWriter writer, int logLevel) {
    if (writer == null) {
      this.logger = TreeLogger.NULL;
    } else {
      this.logger = new PrintWriterTreeLogger(writer);
      ((AbstractTreeLogger) this.logger).setMaxDetail(convertLogLevel(logLevel));
    }
    return this.logger;
  }
View Full Code Here

  private void logReachableTypes(TreeLogger logger) {
    PrintWriter printWriter = null;
    if (logOutputStream != null) {
      // Route the TreeLogger output to an output stream.
      printWriter = new PrintWriter(logOutputStream);
      PrintWriterTreeLogger printWriterTreeLogger = new PrintWriterTreeLogger(
          printWriter);
      printWriterTreeLogger.setMaxDetail(TreeLogger.ALL);
      logger = printWriterTreeLogger;
    }

    logger.log(TreeLogger.DEBUG, "Reachable types computed on: "
        + new Date().toString());
View Full Code Here

    AbstractTreeLogger uiLogger = new SwingTreeLogger(this);
    uiLogger.setMaxDetail(maxLevel);
    TreeLogger bestLogger = uiLogger;
    if (logFile != null) {
      try {
        PrintWriterTreeLogger fileLogger = new PrintWriterTreeLogger(logFile);
        fileLogger.setMaxDetail(maxLevel);
        bestLogger = new CompositeTreeLogger(bestLogger, fileLogger);
      } catch (IOException ex) {
        bestLogger.log(TreeLogger.ERROR, "Can't log to file "
            + logFile.getAbsolutePath(), ex);
      }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.util.log.PrintWriterTreeLogger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.