mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
Merge branch 'master' into add-MultiProperties
This commit is contained in:
commit
b969bb29b2
@ -42,7 +42,7 @@ import java.util.zip.ZipOutputStream;
|
||||
@SpringBootApplication
|
||||
public class Main {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger("Main");
|
||||
private final static Logger log = LoggerFactory.getLogger(Main.class.getName());
|
||||
|
||||
private final static File storeDir = new File("store/");
|
||||
|
||||
|
@ -20,7 +20,7 @@ import java.util.*;
|
||||
|
||||
public class BotAdminCommandProcess {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(BotAdminCommandProcess.class.getSimpleName());
|
||||
private final static Logger log = LoggerFactory.getLogger(BotAdminCommandProcess.class.getName());
|
||||
|
||||
private final static File pushListFile = new File(System.getProperty("cgj.botDataDir"), "pushList.json");
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class BotCommandProcess {
|
||||
|
||||
private final static PixivDownload pixivDownload = new PixivDownload(Main.cookieStore, Main.proxy);
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(BotCommandProcess.class.getSimpleName());
|
||||
private final static Logger log = LoggerFactory.getLogger(BotCommandProcess.class.getName());
|
||||
|
||||
private final static File imageStoreDir = new File(System.getProperty("cgj.botDataDir"), "data/image/cgj/");
|
||||
private final static Gson gson = new GsonBuilder()
|
||||
|
@ -52,8 +52,6 @@ public enum MessageEventExecutionDebugger {
|
||||
}
|
||||
});
|
||||
|
||||
public final static String debuggerLoggerNameTemp = "MessageEventExecuteDebugger-{debugger}";
|
||||
|
||||
public final MessageExecuteDebugger debugger;
|
||||
|
||||
MessageEventExecutionDebugger(MessageExecuteDebugger debugger) {
|
||||
@ -61,7 +59,7 @@ public enum MessageEventExecutionDebugger {
|
||||
}
|
||||
|
||||
public static Logger getDebuggerLogger(MessageEventExecutionDebugger debugger) {
|
||||
return LoggerFactory.getLogger(debuggerLoggerNameTemp.replace("{debugger}", debugger.name()));
|
||||
return LoggerFactory.getLogger(MessageEventExecutionDebugger.class.getName() + "." + debugger.name());
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
|
@ -14,7 +14,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
public class RandomIntervalSendTimer extends TimerTask {
|
||||
|
||||
private final static Timer timer = new Timer("Thread-RIST");
|
||||
private final static Logger log = LoggerFactory.getLogger("RandomIntervalSendTimer");
|
||||
private final static Logger log = LoggerFactory.getLogger(RandomIntervalSendTimer.class.getName());
|
||||
private final static Map<Long, RandomIntervalSendTimer> timerMap = new HashMap<>();
|
||||
|
||||
private final long timerId;
|
||||
|
@ -39,7 +39,7 @@ public class RandomRankingArtworksSender extends AutoSender {
|
||||
super(messageSender);
|
||||
this.mode = mode;
|
||||
this.contentType = contentType;
|
||||
log = LoggerFactory.getLogger("RecommendArtworksSender@" + Integer.toHexString(this.hashCode()));
|
||||
log = LoggerFactory.getLogger(this.toString());
|
||||
this.rankingStart = rankingStart > 0 ? rankingStart : 1;
|
||||
this.rankingStop = rankingStop > 0 ? rankingStop : 150;
|
||||
if(this.rankingStart > this.rankingStop) {
|
||||
|
@ -17,7 +17,7 @@ public class HotDataCacheStore<T> implements CacheStore<T> {
|
||||
private final long expireTime;
|
||||
private final int expireFloatRange;
|
||||
private final Random random = new Random();
|
||||
private final Logger log = LoggerFactory.getLogger(HotDataCacheStore.class.getSimpleName() + "@" + Integer.toHexString(this.hashCode()));
|
||||
private final Logger log = LoggerFactory.getLogger(this.toString());
|
||||
|
||||
/**
|
||||
* 构造热点缓存存储对象
|
||||
|
@ -21,7 +21,7 @@ import java.util.Set;
|
||||
|
||||
public class ImageCacheHandler implements EventHandler {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger("ImageCacheHandler");
|
||||
private final static Logger log = LoggerFactory.getLogger(ImageCacheHandler.class.getName());
|
||||
|
||||
private final static HttpClient httpClient = HttpClientBuilder.create().setProxy(Main.proxy).build();
|
||||
|
||||
|
@ -36,7 +36,7 @@ public abstract class RedisPoolCacheStore<T> implements CacheStore<T> {
|
||||
if(jedisPool.isClosed()) {
|
||||
throw new IllegalStateException("JedisPool is closed");
|
||||
}
|
||||
log = LoggerFactory.getLogger(this.getClass().getSimpleName() + "@" + Integer.toHexString(jedisPool.hashCode()));
|
||||
log = LoggerFactory.getLogger(this.getClass().getName() + "@" + Integer.toHexString(jedisPool.hashCode()));
|
||||
if(!Strings.isNullOrEmpty(keyPrefix)) {
|
||||
this.keyPrefix = keyPrefix.endsWith(".") ? keyPrefix : keyPrefix + ".";
|
||||
} else {
|
||||
|
@ -39,7 +39,7 @@ public class BotEventHandler implements EventHandler {
|
||||
private final ArgumentsRunner processRunner;
|
||||
private final ArgumentsRunner adminRunner;
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger("BotEventHandler");
|
||||
private final static Logger log = LoggerFactory.getLogger(BotEventHandler.class.getName());
|
||||
|
||||
/**
|
||||
* 所有缓存共用的JedisPool
|
||||
|
@ -18,7 +18,7 @@ public class CQPluginMain extends CQPlugin implements EventHandler {
|
||||
public CQPluginMain() {
|
||||
// TODO(LamGC, 2020.04.21): SpringCQ无法适配MessageSenderBuilder
|
||||
BotEventHandler.preLoad();
|
||||
LoggerFactory.getLogger(this.toString())
|
||||
LoggerFactory.getLogger(CQPluginMain.class.getName())
|
||||
.info("BotEventHandler.COMMAND_PREFIX = {}", BotEventHandler.COMMAND_PREFIX);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ import java.util.Properties;
|
||||
|
||||
public class MiraiMain implements Closeable {
|
||||
|
||||
private final Logger log = LoggerFactory.getLogger(this.toString());
|
||||
private final Logger log = LoggerFactory.getLogger(MiraiMain.class.getName());
|
||||
|
||||
private Bot bot;
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class MiraiMessageSender implements MessageSender {
|
||||
|
||||
private final Contact member;
|
||||
private final MessageSource source;
|
||||
private final static Logger log = LoggerFactory.getLogger("MiraiMessageSender");
|
||||
private final static Logger log = LoggerFactory.getLogger(MiraiMessageSender.class.getName());
|
||||
private final static CacheStore<String> imageIdCache = new HotDataCacheStore<>(
|
||||
new StringRedisCacheStore(BotEventHandler.redisServer, "mirai.imageId"),
|
||||
new LocalHashCacheStore<>(),
|
||||
|
@ -33,7 +33,7 @@ import java.util.function.BiConsumer;
|
||||
|
||||
public class PixivDownload {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger("PixivDownload");
|
||||
private final static Logger log = LoggerFactory.getLogger(PixivDownload.class.getName());
|
||||
|
||||
private final HttpClient httpClient;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import java.util.zip.ZipInputStream;
|
||||
*/
|
||||
public final class PixivUgoiraBuilder {
|
||||
|
||||
private final Logger log = LoggerFactory.getLogger(PixivUgoiraBuilder.class.getSimpleName() + "@" + Integer.toHexString(this.hashCode()));
|
||||
private final Logger log = LoggerFactory.getLogger(this.toString());
|
||||
|
||||
private final HttpClient httpClient;
|
||||
private final JsonObject ugoiraMeta;
|
||||
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||
*/
|
||||
public class PixivAccessProxyServer {
|
||||
|
||||
private final Logger log = LoggerFactory.getLogger(this.getClass().getSimpleName());
|
||||
private final Logger log = LoggerFactory.getLogger(PixivAccessProxyServer.class.getName());
|
||||
|
||||
private final HttpProxyServer proxyServer;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class PixivDownloadTest {
|
||||
|
||||
private static CookieStore cookieStore;
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger("PixivDownloadTest");
|
||||
private final static Logger log = LoggerFactory.getLogger(PixivDownloadTest.class.getName());
|
||||
|
||||
private static HttpHost proxy = new HttpHost("127.0.0.1", 1001);
|
||||
|
||||
@ -180,9 +180,8 @@ public class PixivDownloadTest {
|
||||
|
||||
log.info("正在调用方法...");
|
||||
try {
|
||||
pixivDownload.getRankingAsInputStream(null, null, queryDate, 5, 50, PixivDownload.PageQuality.ORIGINAL, (rank, link, rankInfo, inputStream) -> {
|
||||
log.info("空操作");
|
||||
});
|
||||
pixivDownload.getRankingAsInputStream(null, null, queryDate, 5, 50,
|
||||
PixivDownload.PageQuality.ORIGINAL, (rank, link, rankInfo, inputStream) -> log.info("空操作"));
|
||||
} finally {
|
||||
zos.finish();
|
||||
zos.flush();
|
||||
|
Loading…
Reference in New Issue
Block a user