mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-07-03 05:47:26 +00:00
Compare commits
5 Commits
v2.5.2-202
...
v2.5.2-202
Author | SHA1 | Date | |
---|---|---|---|
4ccf2fafbc | |||
f1e58d72ac | |||
9242a1d474 | |||
065d21c4e4 | |||
5eab94c429 |
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
@ -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>
|
||||
|
Reference in New Issue
Block a user