当前位置: 首页>>代码示例>>Java>>正文


Java Logger类代码示例

本文整理汇总了Java中org.vertx.java.core.logging.Logger的典型用法代码示例。如果您正苦于以下问题:Java Logger类的具体用法?Java Logger怎么用?Java Logger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Logger类属于org.vertx.java.core.logging包,在下文中一共展示了Logger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testTimer

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
@Test
public void testTimer() {
    Scheduler scheduler = Scheduler.create(vertx);
    final Calendar target = Calendar.getInstance();
    target.setLenient(true);
    final Logger log = container.logger();
    log.info("Starting timer test at " + target.getTime().toString());
    target.add(Calendar.SECOND, 30);
    log.info("Waiting for callback at " + target.getTime().toString());

    scheduler.setTimer(getTimeOfWeek(target), new Handler<Timer>() {
        public void handle(Timer t) {
            assertTrue(closeEnough(target, Calendar.getInstance()));
            assertTrue(t.getNext() == null);
            testComplete();
        }
    });
}
 
开发者ID:sendgridlabs,项目名称:vertx-scheduler,代码行数:19,代码来源:TestScheduler.java

示例2: testPeriodic

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
@Test
public void testPeriodic() {
    Scheduler scheduler = Scheduler.create(vertx);
    final Calendar target = Calendar.getInstance();
    target.setLenient(true);
    final Logger log = container.logger();
    log.info("Starting periodic test at " + target.getTime().toString());
    target.add(Calendar.SECOND, 30);
    log.info("Waiting for callback at " + target.getTime().toString());

    scheduler.setPeriodic(getTimeOfWeek(target), new Handler<Timer>() {
        public void handle(Timer t) {
            assertTrue(closeEnough(target, Calendar.getInstance()));
            Calendar next = (Calendar)target.clone();
            next.add(Calendar.DAY_OF_MONTH, 7);
            assertTrue(next.getTime().equals(t.getNext()));
            testComplete();
        }
    });
}
 
开发者ID:sendgridlabs,项目名称:vertx-scheduler,代码行数:21,代码来源:TestScheduler.java

示例3: Neo4jRest

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
public Neo4jRest(URI[] uris, boolean ro, Vertx vertx, Logger logger, long checkDelay, int poolSize,
		boolean keepAlive, JsonObject neo4jConfig) {
	nodeManager = new Neo4jRestNodeClient(uris, vertx, checkDelay, poolSize, keepAlive);
	this.ro = ro;
	String path = uris[0].getPath();
	if (path != null && path.endsWith("/")) {
		this.basePath  = path.substring(0, path.length() - 1);
	} else {
		this.basePath = path;
	}
	this.logger = logger;
	if (neo4jConfig != null) {
		JsonArray legacyIndexes = neo4jConfig.getArray("legacy-indexes");
		if (legacyIndexes != null && legacyIndexes.size() > 0) {
			for (Object o : legacyIndexes) {
				if (!(o instanceof JsonObject)) continue;
				JsonObject j = (JsonObject) o;
				createIndex(j);
			}
		}
	}
}
 
开发者ID:web-education,项目名称:mod-neo4j-persistor,代码行数:23,代码来源:Neo4jRest.java

示例4: HystrixCommand

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
public HystrixCommand(final String name, final String group, final int timeoutMs,
		final org.vertx.java.core.logging.Logger logger, final Func0<Observable<T>> func)
{
	super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey(group)) //
			.andCommandKey(HystrixCommandKey.Factory.asKey(name)) //
			.andCommandPropertiesDefaults(HystrixCommandProperties.Setter() //
					.withExecutionIsolationThreadTimeoutInMilliseconds(timeoutMs)));

	if (logger.isDebugEnabled())
	{
		logger.debug("Created command " + this.getCommandKey().name() + ":" + this.getCommandGroup().name());
	}

	this.func = func;
	this.logger = logger;
}
 
开发者ID:marekasf,项目名称:vertex-hystrix,代码行数:17,代码来源:HystrixCommand.java

示例5: RedisPoolNode

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
public RedisPoolNode(JsonObject jsonObject, Logger log, String prefix) {

        super(log, prefix);

        this.channel = jsonObject.getString("channel");

        JedisPoolConfig config = new JedisPoolConfig();
        config.testOnBorrow = true;

        JedisPool jedisPool;

        if (StringUtils.isEmpty(jsonObject.getString("host"))) {
            jedisPool = new JedisPool(config, "localhost");
        } else {
            jedisPool = new JedisPool(config,
                    jsonObject.getString("host"),
                    jsonObject.getInteger("port").intValue());
        }

        this.jedisPool = jedisPool;


        Jedis jedis = this.jedisPool.getResource();
        DEBUG("connected <%s!!> %s", jedis.ping(), jsonObject);
        this.jedisPool.returnResource(jedis);
    }
 
开发者ID:stalk-io,项目名称:stalk-server,代码行数:27,代码来源:RedisPoolNode.java

示例6: ShareBigFilesController

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
/**
 * Creates a new controller.
 */
public ShareBigFilesController(final Storage storage, CrudService crudService,
							   ShareBigFilesService shareBigFilesService, final Logger log, final Long maxQuota,
							   final Long maxRepositoryQuota, final JsonArray expirationDateList) {
	super(ShareBigFiles.SHARE_BIG_FILE_COLLECTION);
	this.log = log;
	this.maxQuota = maxQuota;
	this.maxRepositoryQuota = maxRepositoryQuota;
	this.expirationDateList = expirationDateList;
	this.storage = storage;
	this.shareBigFileCrudService = crudService;
	this.shareBigFilesService = shareBigFilesService;
}
 
开发者ID:OPEN-ENT-NG,项目名称:share-big-files,代码行数:16,代码来源:ShareBigFilesController.java

示例7: findByName

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
private void findByName(Message m) {
    final Parameter<String> params = gson.fromJson(m.body().toString(), Parameter.class);
    Logger logger = container.logger();

    m.reply(gson.toJson(repository.findEmployeeByFirstName(params.getValue("name"))));
    logger.info("reply to: " + m.body());
}
 
开发者ID:amoAHCP,项目名称:vert.x-spring-microservice-demo,代码行数:8,代码来源:EmployeeService.java

示例8: getAll

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
@Path("/employeeAll")
@OperationType(Type.REST_GET)
//@Produces("text/json")
public void getAll(Message m) {
    Logger logger = container.logger();
    m.reply(gson.toJson(repository.getAllEmployees()));
    logger.info("reply to: " + m.body());
}
 
开发者ID:amoAHCP,项目名称:vert.x-spring-microservice-demo,代码行数:9,代码来源:EmployeeVerticleService.java

示例9: findByName

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
@Path("/employeeByName")
// @Produces("text/json")
 @OperationType(Type.REST_GET)
 public void findByName(@QueryParam("name") String name, @QueryParam("lastname") String lastname, Message message) {
     Logger logger = container.logger();
     logger.info("parameter name: " + name + "  : " + lastname);
     message.reply(gson.toJson(repository.findEmployeeByFirstName(name)));
     logger.info("reply to: " + message.body());
 }
 
开发者ID:amoAHCP,项目名称:vert.x-spring-microservice-demo,代码行数:10,代码来源:EmployeeVerticleService.java

示例10: init

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
/**
 * 
 */
@Before
public void init() {
	//Mock the convenience
	this.session = mock(Session.class);
	when(this.session.prepare(any(String.class))).thenReturn(null);
	
	this.logger = mock(Logger.class);
	when(this.logger.isDebugEnabled()).thenReturn(true);
}
 
开发者ID:nea,项目名称:vertx-mod-cassandra-persistor,代码行数:13,代码来源:PreparedStatementCacheTest.java

示例11: closeEnough

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
private boolean closeEnough(Calendar target, Calendar actual) {
    final Logger log = container.logger();
    log.info("Checking that " + target.getTime().toString() + " and " + actual.getTime().toString() + " are very close");
    Calendar end = (Calendar)target.clone();
    end.add(Calendar.SECOND, 1);
    return actual.after(target) && actual.before(end);
}
 
开发者ID:sendgridlabs,项目名称:vertx-scheduler,代码行数:8,代码来源:TestScheduler.java

示例12: start

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
@Override
public void start() {
    final Logger logger = container.logger();
    Yoke yoke = new Yoke(vertx)
        .use(new Favicon())
        .use("/static", new Static("."))
        .use(new BodyParser())
        .use(Router.from(
                new LoginRoute(logger),
                new APIRoute(),
                new LinksRoute(vertx.eventBus(), logger)))
        .listen(8080);

    logger.info("HTTP server initialized");
}
 
开发者ID:diggit-team,项目名称:diggit,代码行数:16,代码来源:WebVerticle.java

示例13: HystrixVertxHttpClient

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
public HystrixVertxHttpClient(final HttpClient client, final int timeoutMs, final String group, final Logger logger)
{
	this.timeoutMs = timeoutMs;
	this.client = client;
	this.group = group;
	this.logger = logger;
}
 
开发者ID:marekasf,项目名称:vertex-hystrix,代码行数:8,代码来源:HystrixVertxHttpClient.java

示例14: RequestBuilder

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
public RequestBuilder(final HttpClient client, final String name, final String group, final Logger logger)
{
	this.name = name;
	this.group = group;
	this.client = client;
	this.logger = logger;
}
 
开发者ID:marekasf,项目名称:vertex-hystrix,代码行数:8,代码来源:RequestBuilder.java

示例15: reportException

import org.vertx.java.core.logging.Logger; //导入依赖的package包/类
/**
 * Reports an exception in the verticle.
 */
@Override
public void reportException(Logger logger, Throwable t) {
  // A Quercus language exception.
  if (t instanceof QuercusException) {
    Env env = Env.getCurrent();
    Location location = env.getLocation();

    logger.error("\nAn exception occured in a PHP verticle.");

    // TODO: This stack trace should show only PHP related called, not
    // Java calls. Currently it only shows the trace of Java code execution.
    // logger.error(env.getStackTraceAsString(t, env.getLocation()) + "\n");
    String className = location.getClassName();
    String funcName = location.getFunctionName();
    if (funcName != null && funcName != "NULL" && !funcName.startsWith("__quercus_")) {
      if (className != "NULL" && funcName != "NULL" && !funcName.startsWith("__quercus_")) {
        logger.error(String.format("%s in %s on line %d in %s::%s()", t.getMessage(), location.getFileName(),
            location.getLineNumber(), className, funcName));
      }
      else {
        logger.error(String.format("%s in %s on line %d in %s()", t.getMessage(), location.getFileName(),
            location.getLineNumber(), funcName));
      }
    }
    else {
      logger.error(String.format("%s in %s on line %d", t.getMessage(), location.getFileName(),
          location.getLineNumber()));
    }
  }
  else {
    t.printStackTrace();
  }
}
 
开发者ID:vert-x,项目名称:mod-lang-php,代码行数:37,代码来源:PhpVerticleFactory.java


注:本文中的org.vertx.java.core.logging.Logger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。