本文整理汇总了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();
}
});
}
示例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();
}
});
}
示例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);
}
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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");
}
示例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;
}
示例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;
}
示例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();
}
}