类 PluginReport

java.lang.Object
cn.afternode.commons.bukkit.report.PluginReport

public class PluginReport extends Object
A report builder for analysing like CrashReport in Minecraft
  • 构造器详细资料

    • PluginReport

      public PluginReport(org.bukkit.plugin.Plugin plugin)
      Primary constructor
      参数:
      plugin - Generated by
  • 方法详细资料

    • appendElement

      public PluginReport appendElement(IPluginReportElement element)
      Append element
      参数:
      element - Element
      返回:
      This builder
    • withServerInfo

      public PluginReport withServerInfo()
      Append ServerInfoElement
      返回:
      This builder
      另请参阅:
    • withPluginInfo

      public PluginReport withPluginInfo()
      Append PluginInfoElement with default properties
      返回:
      This builder
      另请参阅:
    • withPluginList

      public PluginReport withPluginList()
      Append PluginListElement
      返回:
      This builder
      另请参阅:
    • withException

      public PluginReport withException(String title, Throwable throwable)
      Append PluginReport
      参数:
      title - Title
      throwable - Exception
      返回:
      This builder
      另请参阅:
    • withCustom

      public PluginReport withCustom(String title, String content)
      Append custom content
      参数:
      title - Title
      content - Content
      返回:
      This builder
    • build

      public String build()
      Build to string
      返回:
      Result
    • save

      public void save(Path target) throws IOException
      Save to file
      参数:
      target - Output file path
      抛出:
      IOException
    • save

      public Path save() throws IOException
      Save to ~/reports/report-[DateTime]-[PluginName].txt
      返回:
      Output path
      抛出:
      IOException
    • saveToDataFolder

      public Path saveToDataFolder() throws IOException
      Save to plugin data folder
      返回:
      Output path
      抛出:
      IOException
    • saveAndLog

      public Path saveAndLog() throws IOException
      Save to file and print to logger
      返回:
      Output path
      抛出:
      IOException