Compare commits

...

5 Commits

8 changed files with 15 additions and 8 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.lamgc</groupId>
<artifactId>ContentGrabbingJi</artifactId>
<version>2.5.2-20200609.2-SNAPSHOT</version>
<version>2.5.2-20200610.1-SNAPSHOT</version>
<repositories>
<repository>

View File

@ -2,6 +2,8 @@ package net.lamgc.cgj.bot.framework.cli;
import net.lamgc.cgj.bot.boot.ApplicationBoot;
import net.lamgc.cgj.bot.event.BotEventHandler;
import net.lamgc.cgj.bot.framework.cli.message.ConsoleMessageEvent;
import net.lamgc.cgj.bot.framework.cli.message.ConsoleMessageSenderFactory;
import net.lamgc.cgj.bot.message.MessageSenderBuilder;
import org.jline.reader.LineReader;
import org.jline.reader.LineReaderBuilder;

View File

@ -1,4 +1,4 @@
package net.lamgc.cgj.bot.framework.cli;
package net.lamgc.cgj.bot.framework.cli.message;
import net.lamgc.cgj.bot.event.MessageEvent;

View File

@ -1,4 +1,4 @@
package net.lamgc.cgj.bot.framework.cli;
package net.lamgc.cgj.bot.framework.cli.message;
import net.lamgc.cgj.bot.message.MessageSender;

View File

@ -1,4 +1,4 @@
package net.lamgc.cgj.bot.framework.cli;
package net.lamgc.cgj.bot.framework.cli.message;
import net.lamgc.cgj.bot.message.MessageSender;
import net.lamgc.cgj.bot.message.MessageSenderFactory;

View File

@ -49,7 +49,7 @@ public class MiraiMain implements Closeable {
return;
}
Utils.setDefaultLogger(MiraiToSlf4jLogger::new);
Utils.setDefaultLogger(MiraiToSlf4jLoggerAdapter::new);
BotConfiguration configuration = new BotConfiguration();
configuration.setProtocol(BotConfiguration.MiraiProtocol.ANDROID_PAD);
bot = BotFactoryJvm.newBot(Long.parseLong(botProperties.getProperty("bot.qq", "0")), Base64.decodeBase64(botProperties.getProperty("bot.password", "")), configuration);

View File

@ -8,7 +8,12 @@ import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
public class MiraiToSlf4jLogger extends MiraiLoggerPlatformBase {
/**
* MiraiLoggerToSlf4jLogger适配器
* <p>该Logger通过Slf4j的Marker进行标识, loggerName为{@code mirai.[identity]}</p>
* <p>由于适配器适配方式的原因, 日志输出的调用信息将不可用(调用指向了适配器内的方法);</p>
*/
public class MiraiToSlf4jLoggerAdapter extends MiraiLoggerPlatformBase {
private final static Marker marker = MarkerFactory.getMarker("mirai");
@ -16,7 +21,7 @@ public class MiraiToSlf4jLogger extends MiraiLoggerPlatformBase {
private final String identity;
public MiraiToSlf4jLogger(String identity) {
public MiraiToSlf4jLoggerAdapter(String identity) {
this.identity = identity;
this.logger = LoggerFactory.getLogger("mirai." + identity);
}

View File

@ -50,7 +50,7 @@
<AppenderRef ref="STANDARD_STDOUT"/>
<AppenderRef ref="STANDARD_STDERR"/>
</Logger>
<Logger level="TRACE" name="mirai">
<Logger level="INFO" name="mirai">
<AppenderRef ref="STANDARD_STDOUT"/>
<AppenderRef ref="STANDARD_STDERR"/>
</Logger>