Example usage for org.apache.commons.logging Log trace

List of usage examples for org.apache.commons.logging Log trace

Introduction

In this page you can find the example usage for org.apache.commons.logging Log trace.

Prototype

void trace(Object message);

Source Link

Document

Logs a message with trace log level.

Usage

From source file:com.lolay.placefinder.PlaceFinderIntegration.java

public void testReverse() throws Exception {
    final Log log = testReverseLog;
    log.trace("enter");

    PlaceFinderClient client = new PlaceFinderFactory(baseUrl).getPlaceFinder();

    PlaceFinderInvoker invoker = PlaceFinderInvoker.builder().appId(appId).count(1).latitude(37.787082F)
            .longitude(-122.400929F).geocodingFlag("R").build();
    PlaceFinderResultSet response = null;
    try {// ww w.j  a v a 2  s  .co  m
        long start = System.currentTimeMillis();
        response = invoker.location(client);
        long end = System.currentTimeMillis();
        log.trace(String.format("Query took %s ms", end - start));
    } catch (Exception e) {
        log.error(e);
        fail();
    }

    assertNotNull(response);
    assertEquals((Integer) 0, response.getError());

    PlaceFinderResult result = response.getResult();
    assertNotNull(result);
    assertNotNull(result.getCounty());
    assertNotNull(result.getCity());
    assertNotNull(result.getState());
    assertNotNull(result.getStateCode());
}

From source file:com.runwaysdk.business.generation.AspectJCompiler.java

/**
 * Calls the AspectJ Compiler and wraps any errors or failures in a {@link CompilerException}
 *
 * @param args/*  ww  w  . j a v a2  s.  c  om*/
 *          Arguments for the compiler
 * @throws CompilerException
 *           if compilation fails
 */
private void callAJC(String args[]) {
    Log log = LogFactory.getLog(COMPILER_LOG);
    log.trace(Arrays.deepToString(args));

    fails.clear();
    errors.clear();
    warnings.clear();
    infos.clear();

    if (0 < Main.bareMain(args, false, fails, errors, warnings, infos)) {
        // We have errors
        String message = new String();
        for (String error : errors) {
            message += '\n' + error;
        }
        for (String fail : fails) {
            message += '\n' + fail;
        }
        throw new CompilerException("Errors found during compilation:" + message, message);
    }
}

From source file:com.lolay.citygrid.ads.custom.CustomAdsIntegration.java

public void disabledtestBanner() throws Exception {
    final Log log = testBannerLog;
    log.trace("ENTER");

    CustomAdsClient pfpProxy = new ClientFactory(baseUrl).getCustomAds();

    CustomAdsInvoker pfp = CustomAdsInvoker.builder().what("restaurant").where("90069").publisher("citysearch")
            .rotation(true).build();//from w  ww .  j  av a 2s . com
    BannerResults results = null;
    try {
        long start = System.currentTimeMillis();
        results = pfp.banner(pfpProxy);
        long end = System.currentTimeMillis();
        log.trace(String.format("PFP Banner took %s ms", end - start));
    } catch (WebApplicationException e) {
        log.error(e.getResponse(), e);
        fail();
    }

    assertNotNull(results);
    assertNotNull(results.getAds());
    assertEquals(10, results.getAds().size());
    for (BannerAd ad : results.getAds()) {
        assertNotNull(ad.getId());
        assertNotNull(ad.getListingId());
        assertNotNull(ad.getAdDestinationUrl());
        assertNotNull(ad.getAdImageUrl());
    }
}

From source file:hadoopInstaller.logging.CompositeLog.java

@Override
public void trace(Object message) {
    for (Log log : this.logs) {
        log.trace(message);
    }
}

From source file:com.lolay.citygrid.ads.custom.CustomAdsIntegration.java

public void testWhere() throws Exception {
    final Log log = testWhereLog;
    log.trace("ENTER");

    CustomAdsClient pfpProxy = new ClientFactory(baseUrl).getCustomAds();

    CustomAdsInvoker pfp = CustomAdsInvoker.builder().what("restaurant").where("90069").publisher("citysearch")
            .build();/*from w  w w .  j av a 2s.c  o m*/
    CustomAdsResults results = null;
    try {
        long start = System.currentTimeMillis();
        results = pfp.where(pfpProxy);
        long end = System.currentTimeMillis();
        log.trace(String.format("PFP took %s ms", end - start));
    } catch (WebApplicationException e) {
        log.error(e.getResponse(), e);
        fail();
    }

    assertNotNull(results);
    assertNotNull(results.getAds());
    assertEquals(10, results.getAds().size());
    for (CustomAd ad : results.getAds()) {
        assertNotNull(ad.getType());
        assertNotNull(ad.getAdDestinationUrl());

        if (ad.getListingId() != null && ad.getListingId() != 0) {
            assertNotNull(ad.getId());
            assertNotNull(ad.getImpressionId());
            assertNotNull(ad.getName());
            assertNotNull(ad.getLatitude());
            assertNotNull(ad.getLongitude());
            assertNotNull(ad.getGrossPpe());
        } else {
            assertNotNull(ad.getTagline());
            assertNotNull(ad.getDescription());
        }
    }

}

From source file:com.lolay.citygrid.ads.custom.CustomAdsIntegration.java

public void testLatLon() throws Exception {
    final Log log = testLatLonLog;
    log.trace("ENTER");

    CustomAdsClient pfpProxy = new ClientFactory(baseUrl).getCustomAds();

    CustomAdsInvoker pfp = CustomAdsInvoker.builder().what("restaurant").latitude(34.0522222D)
            .longitude(-118.2427778D).radius(50).publisher("citysearch").build();
    CustomAdsResults results = null;/* w  ww . ja va 2 s.  c o m*/
    try {
        long start = System.currentTimeMillis();
        results = pfp.latlon(pfpProxy);
        long end = System.currentTimeMillis();
        log.trace(String.format("PFP location took %s ms", end - start));
    } catch (WebApplicationException e) {
        log.error(e.getResponse(), e);
        fail();
    }

    assertNotNull(results);
    assertNotNull(results.getAds());
    assertEquals(10, results.getAds().size());
    for (CustomAd ad : results.getAds()) {
        assertNotNull(ad.getType());
        assertNotNull(ad.getAdDestinationUrl());

        if (ad.getListingId() != null) {
            assertNotNull(ad.getId());
            assertNotNull(ad.getImpressionId());
            assertNotNull(ad.getName());
            assertNotNull(ad.getLatitude());
            assertNotNull(ad.getLongitude());
            assertNotNull(ad.getGrossPpe());
        } else {
            assertNotNull(ad.getTagline());
            assertNotNull(ad.getDescription());
        }
    }

}

From source file:com.adaptris.http.MessageImp.java

protected void logMessageInfo() {
    Log socketLogger = Http.getSocketLogger();
    if (socketLogger.isTraceEnabled()) {
        socketLogger.trace(toVerboseString());
    } else {//from w w w.j av a2 s.  co m
        logR.trace(toString());
    }
}

From source file:io.netty.logging.CommonsLoggerTest.java

@Test
public void testTrace() {
    Log mock = createStrictMock(Log.class);

    mock.trace("a");
    replay(mock);// w w  w .  j  a  va  2s  .  c o  m

    InternalLogger logger = new CommonsLogger(mock, "foo");
    logger.trace("a");
    verify(mock);
}

From source file:fr.gouv.vitam.utils.logging.CommonsLoggerTest.java

@Test
public void testTrace() {
    final Log mock = createStrictMock(Log.class);

    mock.trace("a");
    replay(mock);//from  www .j a  v  a  2  s.  co  m

    final VitamLogger logger = new CommonsLogger(mock, "foo");
    logger.trace("a");
    verify(mock);
}

From source file:com.zxy.commons.dubbo.TraceInterceptor.java

/**
 * {@inheritDoc}//w  w  w  .j  a va  2  s.  c  o m
 */
@Override
protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
    //        String name = createInvocationTraceName(invocation);
    String invocationDescription = getInvocationDescription(invocation);
    logger.trace("Entering " + invocationDescription);
    RpcContext rpcContext = RpcContext.getContext();
    if (rpcContext != null) {
        String traceId = rpcContext.getAttachment(TRACE_ID);
        if (StringUtils.isNotEmpty(traceId)) {
            logger.trace(invocationDescription + ", traceId: " + traceId);
        } else {
            traceId = UUID.randomUUID().toString().replace("-", "");
            logger.trace(invocationDescription + ", traceId is empty, auto generated, traceId: " + traceId);
        }
        rpcContext.setAttachment(TRACE_ID, traceId);
    }
    Object rval = invocation.proceed();
    logger.trace("Exiting " + invocationDescription);
    return rval;
}