feat: 修改显示前缀

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2017-01-11 00:52:19 +08:00
parent eaddb97888
commit 5f628e08f1
2 changed files with 5 additions and 15 deletions

View File

@ -25,7 +25,7 @@ import pw.yumc.YumCore.kit.LogKit;
* @author * @author
*/ */
public class MonitorManager { public class MonitorManager {
public static String prefix = "§6[§bYum §a能耗监控§6] "; public static String prefix = "§6[§a能耗监控§6] ";
private static String errMsg = prefix + "§c命令执行异常 请反馈下列信息给腐竹!"; private static String errMsg = prefix + "§c命令执行异常 请反馈下列信息给腐竹!";
private static String errP = "§6插件名称: §b%s"; private static String errP = "§6插件名称: §b%s";
private static String errN = "§6异常名称: §c%s"; private static String errN = "§6异常名称: §c%s";
@ -75,8 +75,7 @@ public class MonitorManager {
public static MonitorInfo getMonitorInfo(String pname) { public static MonitorInfo getMonitorInfo(String pname) {
double per = 100.00; double per = 100.00;
return new MonitorInfo(monitor.get(pname) / totalTime * per, cmd.get(pname) / totalTime * per, event.get(pname) return new MonitorInfo(monitor.get(pname) / totalTime * per, cmd.get(pname) / totalTime * per, event.get(pname) / totalTime * per, task.get(pname) / totalTime * per);
/ totalTime * per, task.get(pname) / totalTime * per);
} }
public static void init() { public static void init() {
@ -105,11 +104,7 @@ public class MonitorManager {
int l = e.getStackTrace().length > 5 ? 5 : e.getStackTrace().length; int l = e.getStackTrace().length > 5 ? 5 : e.getStackTrace().length;
for (int i = 0; i < l; i++) { for (int i = 0; i < l; i++) {
StackTraceElement ste = e.getStackTrace()[i]; StackTraceElement ste = e.getStackTrace()[i];
elog(String.format(errStackTrace, elog(String.format(errStackTrace, ste.getClassName(), ste.getMethodName(), ste.getFileName(), ste.getLineNumber()));
ste.getClassName(),
ste.getMethodName(),
ste.getFileName(),
ste.getLineNumber()));
} }
if (debug) { if (debug) {
Log.console(devInfo); Log.console(devInfo);
@ -132,12 +127,7 @@ public class MonitorManager {
} }
public static void sendObject(CommandSender sender) { public static void sendObject(CommandSender sender) {
sender.sendMessage(String.format("totalTime@%s monitor@%s cmd@%s event@%s task@%s", sender.sendMessage(String.format("totalTime@%s monitor@%s cmd@%s event@%s task@%s", totalTime, sum(monitor.values()), sum(cmd.values()), sum(event.values()), sum(task.values())));
totalTime,
sum(monitor.values()),
sum(cmd.values()),
sum(event.values()),
sum(task.values())));
} }
/** /**

View File

@ -23,7 +23,7 @@ import pw.yumc.YumCore.kit.PKit;
public class NetworkManager { public class NetworkManager {
public static void register(Yum plugin) { public static void register(Yum plugin) {
Bukkit.getConsoleSender().sendMessage("§6[§bYum §a网络管理§6] §a注入网络管理系统 将托管服务器网络!"); Bukkit.getConsoleSender().sendMessage("§6[§a网络管理§6] §a注入网络管理系统 将托管服务器网络!");
ProxySelector.setDefault(new YumProxySelector(ProxySelector.getDefault(), plugin)); ProxySelector.setDefault(new YumProxySelector(ProxySelector.getDefault(), plugin));
} }