use of com.firenio.log.Logger in project baseio by generallycloud.
the class TestLog method testSl4J.
static void testSl4J() {
Logger logger = LoggerFactory.getLogger(TestLog.class);
for (int i = 0; i < 1000000; i++) {
logger.info("logback info 成功了..............................................");
logger.error("logback error 成功了..............................................");
logger.debug("logback debug 成功了..............................................");
}
}
use of com.firenio.log.Logger in project baseio by generallycloud.
the class TestLoadClient method main.
public static void main(String[] args) throws Exception {
final Logger logger = LoggerFactory.getLogger(TestLoadClient.class);
final CountDownLatch latch = new CountDownLatch(time);
final AtomicInteger res = new AtomicInteger();
final AtomicInteger req = new AtomicInteger();
IoEventHandle eventHandleAdaptor = new IoEventHandle() {
@Override
public void accept(Channel ch, Frame frame) throws Exception {
// latch.countDown();
// long count = latch.getCount();
// if (count % 10 == 0) {
// if (count < 50) {
// logger.info("************************================" + count);
// }
// }
// logger.info("res==========={}",res.getAndIncrement());
}
};
ChannelConnector context = new ChannelConnector(8300);
context.setIoEventHandle(eventHandleAdaptor);
context.addChannelEventListener(new LoggerChannelOpenListener());
context.addProtocolCodec(new LengthValueCodec());
Channel ch = context.connect();
System.out.println("################## Test start ####################");
long old = Util.now();
for (int i = 0; i < time; i++) {
LengthValueFrame frame = new LengthValueFrame();
frame.write("hello server!", ch);
ch.writeAndFlush(frame);
}
latch.await();
long spend = (Util.past(old));
System.out.println("## Execute Time:" + time);
System.out.println("## OP/S:" + new BigDecimal(time * 1000).divide(new BigDecimal(spend), 2, BigDecimal.ROUND_HALF_UP));
System.out.println("## Expend Time:" + spend);
Util.close(context);
}
use of com.firenio.log.Logger in project baseio by generallycloud.
the class TestLog method testInternalLogger.
static void testInternalLogger() throws IOException {
LoggerFactory.setEnableSLF4JLogger(false);
LoggerFactory.setInternalLogFile(new File("D://test/main.log"));
Logger logger = LoggerFactory.getLogger(TestLog.class);
for (int i = 0; i < 1000; i++) {
logger.info("logback info 成功了..............................................");
logger.error("logback error 成功了..............................................");
logger.debug("logback debug 成功了..............................................");
}
}
use of com.firenio.log.Logger in project baseio by generallycloud.
the class TestLogger method main.
public static void main(String[] args) {
LoggerFactory.setEnableSLF4JLogger(false);
Logger logger = LoggerFactory.getLogger(TestLogger.class);
for (int i = 0; i < 10; i++) {
logger.debug("debug test..........");
logger.info("info test..............");
logger.error("error test......");
}
}
Aggregations