• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SimpleLog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.dv8tion.jda.core.utils.SimpleLog的典型用法代码示例。如果您正苦于以下问题:Java SimpleLog类的具体用法?Java SimpleLog怎么用?Java SimpleLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SimpleLog类属于net.dv8tion.jda.core.utils包,在下文中一共展示了SimpleLog类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onLog

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
@Override
public void onLog(SimpleLog simpleLog, SimpleLog.Level logLevel, Object message) {
	Logger log = convert(simpleLog);
	switch (logLevel) {
		case TRACE:
			if (log.isTraceEnabled()) {
				log.trace(message.toString());
			}
			break;
		case DEBUG:
			if (log.isDebugEnabled()) {
				log.debug(message.toString());
			}
			break;
		case INFO:
			log.info(message.toString());
			break;
		case WARNING:
			log.warn(message.toString());
			break;
		case FATAL:
			log.error(message.toString());
			break;
	}
}
 
开发者ID:Mantaro,项目名称:MantaroRPG,代码行数:26,代码来源:SimpleLogToSLF4JAdapter.java


示例2: initialize

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
private void initialize()
{
	this.commandQueue 	= new LinkedList<Command>();
	this.log 			= SimpleLog.getLog("WeenieBot");
	this.isLocked		= false;
	
	// Load the properties from prop.properties
	loadProperties();
	
	// Initialize the sound library and player
	this.library = new SoundLibrary(properties.getProperty("directory", "sounds"));
	this.player = new SoundPlayer();
	
	initializeBot();
	
	// Schedule the command timer <Default 1 second ticks>
	commandTimer = new Timer();
	commandTimer.scheduleAtFixedRate(new Tick(), 0, 1000);
}
 
开发者ID:SegfaultError11,项目名称:WeenieBot,代码行数:20,代码来源:WeenieBot.java


示例3: loadData

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
public void loadData() {
    samaritan.getLogger().writeFrom("Quote Handler", "Loading channel histories...");
    for (TextChannel messageChannel : jda.getTextChannels()) {
        try {
            List<Message> messages = new ArrayList<>();
            MessageHistory messageHistory = new MessageHistory(messageChannel);
            RestAction.LOG.setLevel(SimpleLog.LEVEL.OFF);
            messageHistory.retrievePast(100).queue((messageList) -> {
                messages.addAll(messageHistory.getCachedHistory());
                messageChannelListMap.put(messageChannel, messages);
            });

        } catch (Exception exc) {
        }
    }
}
 
开发者ID:iSach,项目名称:Samaritan,代码行数:17,代码来源:QuoteHandler.java


示例4: initJda

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
/**
 * Starts JDA.
 *
 * @return {@code true} if everything went well, {@code false} otherwise.
 */
private boolean initJda() {

    try {
        SimpleLog.Level level = JDAImpl.LOG.getLevel();
        SimpleLog.Level socketLevel = WebSocketClient.LOG.getLevel();
        JDAImpl.LOG.setLevel(SimpleLog.Level.OFF);
        WebSocketClient.LOG.setLevel(SimpleLog.Level.OFF);

        jda = new JDABuilder(AccountType.BOT).setToken(botToken).buildBlocking();
        jda.getPresence().setGame(Game.of("2.0.2"));
        logger.writeFrom("jda", "Successfully connected!");
        logger.writeFrom("jda WebSocket", "Connected to WebSocket!");

        JDAImpl.LOG.setLevel(level);
        WebSocketClient.LOG.setLevel(socketLevel);
    } catch (LoginException | InterruptedException | RateLimitedException e) {
        logger.writeFrom("jda", "Couldn't connect!");
        e.printStackTrace();
        return false;
    }
    return true;
}
 
开发者ID:iSach,项目名称:Samaritan,代码行数:28,代码来源:Samaritan.java


示例5: SoundPlayer

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
public SoundPlayer()
{
	log = SimpleLog.getLog("SoundPlayer");
	
	playerManager = new DefaultAudioPlayerManager();
	playerManager.getConfiguration().setResamplingQuality(AudioConfiguration.ResamplingQuality.MEDIUM);
	playerManager.registerSourceManager(new LocalAudioSourceManager());
	player = playerManager.createPlayer();
	player.addListener(this);
}
 
开发者ID:SegfaultError11,项目名称:WeenieBot,代码行数:11,代码来源:SoundPlayer.java


示例6: DiscordAPI

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
private DiscordAPI() {
    SimpleLog JDASocketLog = SimpleLog.getLog("JDASocket");
    JDASocketLog.setLevel(SimpleLog.Level.OFF);

    SimpleLog JDALog = SimpleLog.getLog("JDA");
    JDALog.setLevel(SimpleLog.Level.OFF);

    Thread.setDefaultUncaughtExceptionHandler(com.gmt2001.UncaughtExceptionHandler.instance());
}
 
开发者ID:GloriousEggroll,项目名称:quorrabot,代码行数:10,代码来源:DiscordAPI.java


示例7: install

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
public static void install() {
	SimpleLog.addListener(new SimpleLogToSLF4JAdapter());
	SimpleLog.LEVEL = SimpleLog.Level.OFF;
}
 
开发者ID:Mantaro,项目名称:MantaroRPG,代码行数:5,代码来源:SimpleLogToSLF4JAdapter.java


示例8: onError

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
@Override
public void onError(SimpleLog simpleLog, Throwable err) {
	convert(simpleLog).error("An exception occurred", err);
}
 
开发者ID:Mantaro,项目名称:MantaroRPG,代码行数:5,代码来源:SimpleLogToSLF4JAdapter.java


示例9: convert

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
private Logger convert(SimpleLog log) {
	return logS.computeIfAbsent(log, ignored -> LoggerFactory.getLogger(log.name));
}
 
开发者ID:Mantaro,项目名称:MantaroRPG,代码行数:4,代码来源:SimpleLogToSLF4JAdapter.java


示例10: ChatListener

import net.dv8tion.jda.core.utils.SimpleLog; //导入依赖的package包/类
public ChatListener(String toggleChar, int maxMessageSize)
{
	this.toggleChar 	= toggleChar;
	this.maxMessageSize = maxMessageSize;
	log = SimpleLog.getLog("ChatListener");
}
 
开发者ID:SegfaultError11,项目名称:WeenieBot,代码行数:7,代码来源:ChatListener.java



注:本文中的net.dv8tion.jda.core.utils.SimpleLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InstantiationStrategy类代码示例发布时间:2022-05-22
下一篇:
Java GETFIELD类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap