Examples of LocationInfo


Examples of com.vaadin.server.widgetsetutils.ClassPathExplorer.LocationInfo

            // Ensure file exists
            addonImports.createNewFile();
        }

        LocationInfo info = ClassPathExplorer
                .getAvailableWidgetSetsAndStylesheets();

        try {
            PrintStream printStream = new PrintStream(new FileOutputStream(
                    addonImports));

            printStream.println("/* " + ADDON_IMPORTS_FILE_TEXT + " */");

            printStream.println("/* Do not manually edit this file. */");

            printStream.println();

            Map<String, URL> addonThemes = info.getAddonStyles();

            // Sort addon styles so that CSS imports are first and SCSS import
            // last
            List<String> paths = new ArrayList<String>(addonThemes.keySet());
            Collections.sort(paths, new Comparator<String>() {
View Full Code Here

Examples of org.apache.log4j.spi.LocationInfo

    assertEquals(2, listAppender.list.size());

    {
      LoggingEvent e = listAppender.list.get(0);
      LocationInfo li = e.getLocationInformation();
      assertEquals(this.getClass().getName(), li.getClassName());
      assertEquals(""+line, li.getLineNumber());
    }
   
    {
      LoggingEvent e = listAppender.list.get(1);
      LocationInfo li = e.getLocationInformation();
      assertEquals(this.getClass().getName(), li.getClassName());
      assertEquals(""+(line+1), li.getLineNumber());
    }

  }
View Full Code Here

Examples of org.apache.log4j.spi.LocationInfo

    assertEquals(2, listAppender.list.size());
    for (int i=0; i < 2; ++i) {
      LoggingEvent event = listAppender.list.get(i);
      verify(event, data[i].toXML());
      LocationInfo li = event.getLocationInformation();
      assertEquals(this.getClass().getName(), li.getClassName());
      assertEquals(event.getMDC("hostname"), "localhost");
    }
  }
View Full Code Here

Examples of org.apache.log4j.spi.LocationInfo

    // get the location info in the event.
    // Note that this must have been computed previously
    // within an appender for the following assertion to
    // work properly
    LocationInfo li = le.getLocationInformation();
    System.out.println(li.fullInfo);
    assertEquals("SLF4JBridgeHandlerTest.java", li.getFileName());
    assertEquals("testSmoke", li.getMethodName());
  }
View Full Code Here

Examples of org.apache.log4j.spi.LocationInfo

     // Capture the logging output without actually logging it
     appender.addFilter(new org.apache.log4j.spi.Filter() {
       @Override
       public int decide(LoggingEvent event) {
         records.add(event);
         LocationInfo l = event.getLocationInformation();
         System.out.printf("[%s:%s] %s%n", l.getFileName(), l.getLineNumber(), event.getMessage());
         assertEquals(TestLog4jLogger_impl.this.getClass().getSimpleName()+".java",
                 l.getFileName());
         return org.apache.log4j.spi.Filter.DENY;
       }
     });
    
      // create Logger
View Full Code Here

Examples of org.apache.log4j.spi.LocationInfo

     // Capture the logging output without actually logging it
     appender.addFilter(new org.apache.log4j.spi.Filter() {
       @Override
       public int decide(LoggingEvent event) {
         records.add(event);
         LocationInfo l = event.getLocationInformation();
         System.out.printf("[%s:%s] %s%n", l.getFileName(), l.getLineNumber(), event.getMessage());
         assertEquals(TestLog4jLogger_impl.this.getClass().getSimpleName()+".java",
                 l.getFileName());
         return org.apache.log4j.spi.Filter.DENY;
       }
     });

      // create Logger
View Full Code Here

Examples of org.apache.log4j.spi.location.LocationInfo

                    Level levelImpl = Level.toLevel(level);
                    LoggingEvent event = new LoggingEvent(
                            eventLogger.getName(), eventLogger, levelImpl,
                            message, null);
                    event.setLocationInformation(new LocationInfo(fileName,
                            className, methodName, lineNumber));
                    properties.putAll(mdc);
                    event.setTimeStamp(timeStamp);
                    event.setThrowableInformation(new ThrowableInformation(
                            exception));
View Full Code Here

Examples of org.apache.log4j.spi.location.LocationInfo

        String lineNumber = rs.getString(12).trim();

        if (fileName.equals(LocationInfo.NA)) {
          event.setLocationInformation(LocationInfo.NA_LOCATION_INFO);
        } else {
          event.setLocationInformation(new LocationInfo(fileName, className,
              methodName, lineNumber));
        }

        long id = rs.getLong(13);
        //LogLog.info("Received event with id=" + id);
View Full Code Here

Examples of org.apache.log4j.spi.location.LocationInfo

    properties.put(Constants.APPLICATION_KEY, fileURL);

    //all remaining entries in fieldmap are properties
    properties.putAll(fieldMap);

    LocationInfo info = null;

    if ((eventFileName != null) || (className != null) || (methodName != null)
        || (lineNumber != null)) {
      info = new LocationInfo(eventFileName, className, methodName, lineNumber);
    } else {
      info = LocationInfo.NA_LOCATION_INFO;
    }

    LoggingEvent event = new LoggingEvent();
View Full Code Here

Examples of org.apache.log4j.spi.location.LocationInfo

   */
  public LocationInfo getLocationInformation() {
    // we rely on the fact that fqnOfLoggerClass does not survive
    // serialization
    if (locationInfo == null && fqnOfLoggerClass != null) {
      locationInfo = new LocationInfo(new Throwable(), fqnOfLoggerClass);
    }
    return locationInfo;
  }
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.