Nicer format for verbose meta logging

This commit is contained in:
Luck 2018-10-28 21:56:42 +00:00
parent 45b4e1463f
commit aaeaf5cfa0
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 10 additions and 9 deletions

View File

@ -78,7 +78,8 @@ public enum Message {
"{PREFIX}&3LOG &3&l> &f{}", "{PREFIX}&3LOG &3&l> &f{}",
false false
), ),
VERBOSE_LOG("&3VB &3&l> &a{}&7 - &a{}&7 - {}{}", true), VERBOSE_LOG_PERMISSION("&3VB &3&l> &a{}&7 - &a{}&7 - {}{}", true),
VERBOSE_LOG_META("&3VB &3&l> &a{}&7 - &bmeta: &a{}&7 - &7{}", true),
EXPORT_LOG("&3EXPORT &3&l> &f{}", true), EXPORT_LOG("&3EXPORT &3&l> &f{}", true),
EXPORT_LOG_PROGRESS("&3EXPORT &3&l> &7{}", true), EXPORT_LOG_PROGRESS("&3EXPORT &3&l> &7{}", true),
MIGRATION_LOG("&3MIGRATION &7[&3{}&7] &3&l> &f{}", true), MIGRATION_LOG("&3MIGRATION &7[&3{}&7] &3&l> &f{}", true),

View File

@ -142,7 +142,7 @@ public class VerboseListener {
// just send as a raw message // just send as a raw message
if (event instanceof PermissionCheckEvent) { if (event instanceof PermissionCheckEvent) {
PermissionCheckEvent permissionEvent = (PermissionCheckEvent) event; PermissionCheckEvent permissionEvent = (PermissionCheckEvent) event;
Message.VERBOSE_LOG.send(this.notifiedSender, Message.VERBOSE_LOG_PERMISSION.send(this.notifiedSender,
permissionEvent.getCheckTarget(), permissionEvent.getCheckTarget(),
permissionEvent.getPermission(), permissionEvent.getPermission(),
getTristateColor(permissionEvent.getResult()), getTristateColor(permissionEvent.getResult()),
@ -150,10 +150,9 @@ public class VerboseListener {
); );
} else if (event instanceof MetaCheckEvent) { } else if (event instanceof MetaCheckEvent) {
MetaCheckEvent metaEvent = (MetaCheckEvent) event; MetaCheckEvent metaEvent = (MetaCheckEvent) event;
Message.VERBOSE_LOG.send(this.notifiedSender, Message.VERBOSE_LOG_META.send(this.notifiedSender,
metaEvent.getCheckTarget(), metaEvent.getCheckTarget(),
metaEvent.getKey() + " (meta)", metaEvent.getKey(),
"&7",
metaEvent.getResult() metaEvent.getResult()
); );
} else { } else {
@ -167,7 +166,7 @@ public class VerboseListener {
if (event instanceof PermissionCheckEvent) { if (event instanceof PermissionCheckEvent) {
PermissionCheckEvent permissionEvent = (PermissionCheckEvent) event; PermissionCheckEvent permissionEvent = (PermissionCheckEvent) event;
textComponent = Message.VERBOSE_LOG.asComponent(this.notifiedSender.getPlugin().getLocaleManager(), textComponent = Message.VERBOSE_LOG_PERMISSION.asComponent(this.notifiedSender.getPlugin().getLocaleManager(),
permissionEvent.getCheckTarget(), permissionEvent.getCheckTarget(),
permissionEvent.getPermission(), permissionEvent.getPermission(),
getTristateColor(permissionEvent.getResult()), getTristateColor(permissionEvent.getResult()),
@ -175,10 +174,9 @@ public class VerboseListener {
); );
} else if (event instanceof MetaCheckEvent) { } else if (event instanceof MetaCheckEvent) {
MetaCheckEvent metaEvent = (MetaCheckEvent) event; MetaCheckEvent metaEvent = (MetaCheckEvent) event;
textComponent = Message.VERBOSE_LOG.asComponent(this.notifiedSender.getPlugin().getLocaleManager(), textComponent = Message.VERBOSE_LOG_META.asComponent(this.notifiedSender.getPlugin().getLocaleManager(),
metaEvent.getCheckTarget(), metaEvent.getCheckTarget(),
metaEvent.getKey() + " (meta)", metaEvent.getKey(),
"&7",
metaEvent.getResult() metaEvent.getResult()
); );
} else { } else {
@ -190,10 +188,12 @@ public class VerboseListener {
if (event instanceof PermissionCheckEvent) { if (event instanceof PermissionCheckEvent) {
PermissionCheckEvent permissionEvent = (PermissionCheckEvent) event; PermissionCheckEvent permissionEvent = (PermissionCheckEvent) event;
hover.add("&aType: &2permission");
hover.add("&bOrigin: &2" + permissionEvent.getOrigin().name()); hover.add("&bOrigin: &2" + permissionEvent.getOrigin().name());
} }
if (event instanceof MetaCheckEvent) { if (event instanceof MetaCheckEvent) {
MetaCheckEvent metaEvent = (MetaCheckEvent) event; MetaCheckEvent metaEvent = (MetaCheckEvent) event;
hover.add("&aType: &2meta");
hover.add("&bOrigin: &2" + metaEvent.getOrigin().name()); hover.add("&bOrigin: &2" + metaEvent.getOrigin().name());
} }