Examples of LogFormat


Examples of com.baulsupp.kolja.log.viewer.importing.LogFormat

    return files;
  }

  public static LogFormat loadFormat(CommandLine cmd) throws Exception {
    LogFormat format;
    if (cmd.hasOption("c")) {
      format = (LogFormat) Class.forName(cmd.getOptionValue("c")).newInstance();
    } else if (cmd.hasOption("x")) {
      String configName = cmd.getOptionValue("x");
      format = SavedLogFormatLoader.load(configName);
View Full Code Here

Examples of com.baulsupp.kolja.log.viewer.importing.LogFormat

  }

  private static void run(CommandLine cmd) throws Exception {
    final TailMinusEff tail = new TailMinusEff();

    LogFormat format = CatMain.loadFormat(cmd);

    tail.setAnsi(!cmd.hasOption("a"));

    List<File> files = commandFiles(cmd);
    Iterator<Line> bli = IoUtil.loadFiles(format, files, true);

    tail.setI(bli);

    if (cmd.hasOption("o")) {
      tail.setRenderer(PrintfRenderer.parse(cmd.getOptionValue("o")));
    } else if (cmd.hasOption("d")) {
      tail.setRenderer(new DebugRenderer());
    } else {
      Renderer<Line> renderer = format.getLineRenderer();
      if (files.size() > 1 && renderer instanceof FieldRenderer) {
        FieldRenderer fieldRenderer = (FieldRenderer) renderer;
        fieldRenderer.prependColumn(LogConstants.FILE_NAME, IoUtil.getMaxFilenameWidth(files));
        fieldRenderer.addHighlight(new FilenameHighlight());
      }
View Full Code Here

Examples of com.baulsupp.kolja.log.viewer.importing.LogFormat

    }
  }

  private static void runTool(CommandLine cmd, File f) throws InstantiationException, IllegalAccessException,
      ClassNotFoundException, Exception, IOException {
    LogFormat format;
    if (cmd.hasOption("c")) {
      format = (LogFormat) Class.forName(cmd.getOptionValue("c")).newInstance();
    } else if (cmd.hasOption("x")) {
      String configName = cmd.getOptionValue("x");
      format = SavedLogFormatLoader.load(configName);
    } else {
      format = new PlainTextLogFormat();
    }

    WrappedCharBuffer buffer = WrappedCharBuffer.fromFile(f);

    Less tool = new Less();
    tool.createDefaultCommands();
    tool.addCommand(new RendererCommand(tool, format));
    tool.addCommand(new ModelsCommand(format, buffer, tool));
    if (format.supportsEvents()) {
      tool.addCommand(new SelectEventCommand(format, tool));
    }
    if (format.supportsRequests()) {
      tool.addCommand(new SelectRequestCommand(format, tool));
    }
    tool.addCommand(new ScrollbarCommand(tool, buffer));

    tool.setLineNumbers(BasicLineNumberIndex.create(buffer));
View Full Code Here

Examples of com.sk89q.worldedit.util.logging.LogFormat

        // Register this instance for command events
        worldEdit.getEventBus().register(this);

        // Setup the logger
        commandLog.addHandler(dynamicHandler);
        dynamicHandler.setFormatter(new LogFormat());

        // Set up the commands manager
        ParametricBuilder builder = new ParametricBuilder();
        builder.setAuthorizer(new ActorAuthorizer());
        builder.setDefaultCompleter(new UserCommandCompleter(platformManager));
View Full Code Here

Examples of org.jfree.chart.util.LogFormat

     *
     * @since 1.0.7
     */
    public static TickUnitSource createLogTickUnits(Locale locale) {
        TickUnits units = new TickUnits();
        NumberFormat numberFormat = new LogFormat();
        units.add(new NumberTickUnit(0.05, numberFormat, 2));
        units.add(new NumberTickUnit(0.1, numberFormat, 10));
        units.add(new NumberTickUnit(0.2, numberFormat, 2));
        units.add(new NumberTickUnit(0.5, numberFormat, 5));
        units.add(new NumberTickUnit(1, numberFormat, 10));
View Full Code Here

Examples of org.jfree.chart.util.LogFormat

    /**
     * Check that the equals() method distinguishes all fields.
     */
    public void testEquals() {
        LogFormat f1 = new LogFormat(10.0, "10", true);
        LogFormat f2 = new LogFormat(10.0, "10", true);
        assertEquals(f1, f2);

        f1 = new LogFormat(11.0, "10", true);
        assertFalse(f1.equals(f2));
        f2 = new LogFormat(11.0, "10", true);
        assertTrue(f1.equals(f2));

        f1 = new LogFormat(11.0, "11", true);
        assertFalse(f1.equals(f2));
        f2 = new LogFormat(11.0, "11", true);
        assertTrue(f1.equals(f2));

        f1 = new LogFormat(11.0, "11", false);
        assertFalse(f1.equals(f2));
        f2 = new LogFormat(11.0, "11", false);
        assertTrue(f1.equals(f2));

        f1.setExponentFormat(new DecimalFormat("0.000"));
        assertFalse(f1.equals(f2));
        f2.setExponentFormat(new DecimalFormat("0.000"));
        assertTrue(f1.equals(f2));
    }
View Full Code Here

Examples of org.jfree.chart.util.LogFormat

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashcode() {
        LogFormat f1 = new LogFormat(10.0, "10", true);
        LogFormat f2 = new LogFormat(10.0, "10", true);
        assertTrue(f1.equals(f2));
        int h1 = f1.hashCode();
        int h2 = f2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.chart.util.LogFormat

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        LogFormat f1 = new LogFormat(10.0, "10", true);
        LogFormat f2 = null;
        try {
            f2 = (LogFormat) f1.clone();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
        assertTrue(f1 != f2);
        assertTrue(f1.getClass() == f2.getClass());
        assertTrue(f1.equals(f2));
    }
View Full Code Here

Examples of org.jfree.chart.util.LogFormat

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        LogFormat f1 = new LogFormat(10.0, "10", true);
        LogFormat f2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(f1);
            out.close();
View Full Code Here

Examples of org.jfree.chart.util.LogFormat

    /**
     * Check that the equals() method distinguishes all fields.
     */
    public void testEquals() {
        LogFormat f1 = new LogFormat(10.0, "10", true);
        LogFormat f2 = new LogFormat(10.0, "10", true);
        assertEquals(f1, f2);

        f1 = new LogFormat(11.0, "10", true);
        assertFalse(f1.equals(f2));
        f2 = new LogFormat(11.0, "10", true);
        assertTrue(f1.equals(f2));

        f1 = new LogFormat(11.0, "11", true);
        assertFalse(f1.equals(f2));
        f2 = new LogFormat(11.0, "11", true);
        assertTrue(f1.equals(f2));

        f1 = new LogFormat(11.0, "11", false);
        assertFalse(f1.equals(f2));
        f2 = new LogFormat(11.0, "11", false);
        assertTrue(f1.equals(f2));

        f1.setExponentFormat(new DecimalFormat("0.000"));
        assertFalse(f1.equals(f2));
        f2.setExponentFormat(new DecimalFormat("0.000"));
        assertTrue(f1.equals(f2));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.