当前位置: 首页>>代码示例>>Java>>正文


Java LogLevel类代码示例

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


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

示例1: publish

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void publish(LogRecord record) {
	String message = record.getMessage();
	LogLevel level = toNukkitLevel(record.getLevel());
	if (level == null) {
		return;
	}

	Throwable thrown = record.getThrown();
	if (thrown == null) {
		nukkit.log(level, message);
	} else {
		nukkit.log(level, message, thrown);
	}
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:16,代码来源:PokkitLogger.java

示例2: toNukkitLevel

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
private LogLevel toNukkitLevel(Level level) {
	if (level == Level.SEVERE) {
		return LogLevel.ERROR;
	}
	if (level == Level.WARNING) {
		return LogLevel.WARNING;
	}
	if (level == Level.INFO) {
		return LogLevel.INFO;
	}
	if (level == Level.CONFIG || level == Level.FINE) {
		return LogLevel.DEBUG;
	}
	return null;
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:16,代码来源:PokkitLogger.java

示例3: start

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
/**
 * Start measuring statistics. This will immediately create an async repeating task as the plugin and send the
 * initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200
 * ticks.
 *
 * @return True if statistics measuring is running, otherwise false.
 */
public boolean start() {
    // Is metrics already running?
    if (this.taskId != -1) {
        return true;
    }
    // Begin hitting the server with glorious data
    this.taskId = TaskManager.IMP.repeatAsync(new Runnable() {
        private boolean firstPost = true;
        @Override
        public void run() {
            try {
                postPlugin(!this.firstPost);
                // After the first post we set firstPost to
                // false
                // Each post thereafter will be a ping
                this.firstPost = false;
            } catch (IOException e) {
                MainUtil.handleError(e);
                if (Metrics.this.debug) {
                    plugin.getLogger().log(LogLevel.INFO, "[Metrics] " + e.getMessage());
                }
            }
        }
    }, PING_INTERVAL * 1200);
    return true;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:34,代码来源:Metrics.java

示例4: start

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
/**
 * Start measuring statistics. This will immediately create an async repeating task as the plugin and send the
 * initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200
 * ticks.
 *
 * @return True if statistics measuring is running, otherwise false.
 */
public boolean start() {
    // Is metrics already running?
    if (this.taskId != -1) {
        return true;
    }
    // Begin hitting the server with glorious data
    this.taskId = TaskManager.IMP.taskRepeatAsync(new Runnable() {
        private boolean firstPost = true;
        @Override
        public void run() {
            try {
                postPlugin(!this.firstPost);
                // After the first post we set firstPost to
                // false
                // Each post thereafter will be a ping
                this.firstPost = false;
            } catch (IOException e) {
                e.printStackTrace();
                if (Metrics.this.debug) {
                    plugin.getLogger().log(LogLevel.INFO, "[Metrics] " + e.getMessage());
                }
            }
        }
    }, PING_INTERVAL * 1200);
    return true;
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:34,代码来源:Metrics.java

示例5: emergency

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void emergency(String message) {
    this.log(LogLevel.EMERGENCY, message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java

示例6: alert

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void alert(String message) {
    this.log(LogLevel.ALERT, message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java

示例7: critical

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void critical(String message) {
    this.log(LogLevel.CRITICAL, message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java

示例8: error

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void error(String message) {
    this.log(LogLevel.ERROR, message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java

示例9: warning

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void warning(String message) {
    this.log(LogLevel.WARNING, message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java

示例10: notice

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void notice(String message) {
    this.log(LogLevel.NOTICE, message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java

示例11: info

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void info(String message) {
    this.log(LogLevel.INFO, message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java

示例12: debug

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void debug(String message) {
    this.log(LogLevel.DEBUG, message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java

示例13: log

import cn.nukkit.utils.LogLevel; //导入依赖的package包/类
@Override
public void log(LogLevel level, String message) {
    Server.getInstance().getLogger().log(level, this.pluginName + message);
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:5,代码来源:PluginLogger.java


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