Add comments in “logging-api” module .

This commit is contained in:
wusheng 2017-01-09 09:59:04 +08:00
parent d0bb872553
commit f5de30b101
4 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,10 @@
package com.a.eye.skywalking.logging.api;
/**
* The Log interface.
* It's very easy to understand, like any other log-component.
* Do just like log4j or log4j2 does.
* <p>
* Created by xin on 2016/11/10.
*/
public interface ILog {

View File

@ -1,6 +1,14 @@
package com.a.eye.skywalking.logging.api;
/**
* LogManager is the {@link LogResolver} implementation manager.
* By using {@link LogResolver}, {@link LogManager#getLogger(Class)} returns a {@link ILog} implementation.
* This module use this class as the main entrance, and block the implementation detail about log-component.
* In different modules, like server or sniffer, it will use different implementations.
* <p>
* If no {@link LogResolver} is registered, return {@link NoopLogger#INSTANCE} to avoid {@link NullPointerException}.
* If {@link LogManager#setLogResolver(LogResolver)} is called twice, the second will override the first without any warning or exception.
* <p>
* Created by xin on 2016/11/10.
*/
public class LogManager {

View File

@ -1,8 +1,14 @@
package com.a.eye.skywalking.logging.api;
/**
* {@link LogResolver} just do only one thing: return the {@link ILog} implementation.
* <p>
* Created by xin on 2016/11/10.
*/
public interface LogResolver {
/**
* @param clazz, the class is showed in log message.
* @return {@link ILog} implementation.
*/
ILog getLogger(Class<?> clazz);
}

View File

@ -2,9 +2,12 @@ package com.a.eye.skywalking.logging.api;
/**
* No operation logger implementation.
* Just implement {@link ILog} interface, but do nothing.
* <p>
* Created by xin on 2016/11/10.
*/
public class NoopLogger implements ILog{
public class NoopLogger implements ILog {
public static final ILog INSTANCE = new NoopLogger();
@Override