exLog 是一款用于 Bukkit 的日志记录插件,也是颇受欢迎的 Log 插件 的官方继任者。那么,它与其他插件(如 LogBlock 和 LogEx)有何不同呢?答案是:模块化。
我们都曾有过这样的烦恼体验:下载一个插件后,不得不翻阅庞大的配置文件,只为启用那 100 个功能中我们真正需要的 1 或 2 个。exLog 则与众不同。它是一个日志平台,自身不提供任何可见功能。日志源和数据提供者的功能由单独的模块提供,其方式类似于 Bukkit 及其插件架构。
通过这种方式,exLog 可以在不牺牲所需功能的前提下,保持尽可能轻量级。
请勿使用主页上的下载按钮
它可能链接到错误的文件!请遵循“基本安装”部分中的说明进行操作!
可用模块
- exLog core
- JSON data provider
- SQLite data provider
- basic block logging source(方块放置与破坏、水桶使用)
计划中的模块
- binary data provider
- redstone logging source(门/按钮/拉杆操作)
- mob logging source(苦力怕/末影人/凋灵方块交互)
- WorldEdit logging source
- chest logging source
- command logging source
此外,还将提供一个文档完善的 API,供希望基于 exLog 框架实现自定义日志源或数据提供者的任何人使用。
基本安装
- 从 Files 页面 下载最新的 Core、JSON 和 Block Logging jar 文件。确保 Data API Level 和 Block API Level 匹配。
- 推荐:Core 0.3.0, JSON 0.3.0/SQLite 0.3.0, Block Logging 0.3.0.
- 旧版:Core 0.2.0, JSON 0.2.0/SQLite 0.2.0, Block Logging 0.1.0.
- 将这三个 jar 文件放入你的 Bukkit 安装目录中的 plugins 文件夹。
- 就这样!该插件现在应已预配置为将方块放置和破坏记录到 Bukkit 目录下的 database.json 文件中。
- 手持木棍或骨头右键点击方块,即可查看其历史记录。
- 权限详情可在 plugin.yml 中找到。
高级安装
- 你可以通过下载并将相应的 jar 文件复制到 Bukkit 安装目录的 plugins 文件夹中来安装额外模块。
- 这些模块需要在 plugins/ExLog/config.yml 文件中激活。
- dataProvider 接受单个 String 值,即数据提供者的内部插件名称。
- loggingSources 接受一个 String 值列表,即日志源的内部插件名称。
- dateFormat 接受单个 String 值,即用于输入和输出的日期格式。
高级用法
- 使用 ‘/exlog [command] [args]’ 或等效的 ‘/el [command] [args]’ 访问高级 exLog 命令。
- 有效命令包括 ‘help’, ‘info’, ‘test’, ‘query’ 和 ‘queryu’。你只需要了解 query/u 即可。
- query 接受一个 JSON 对象作为参数。有效键包括 ’player’ 和 ‘origin’(接受字符串)、‘x’, ‘y’, ‘z’ 和 ‘dimension’(接受整数)、‘date’(接受长整型)、‘dateMin’ 和 ‘dateMax’(接受字符串,根据 config.yml 中的 dateFormat 格式化),以及 ‘otherData’(接受 JSON 对象)。成功执行命令不需要任何键。
- queryu 相同,但会同时显示 UUID 和玩家名称。
- 返回与我相关的所有条目:/el query {"player":"RunasSudo"}
- 返回所有主世界方块的放置记录:/el query {"dimension":0,"origin":"ExLogBlockLoggingSource","otherData":{"type":"1"}}
回滚与删除
- 回滚功能仍处于测试阶段。对于因使用回滚而导致的任何世界或数据库损坏,本人不承担责任。但我非常乐意听取你的反馈!
- 要进行回滚,首先执行 ‘/exlog rollback [query]’ 或 ‘/el rb [query]’。
- 插件将根据查询列出所有待回滚的事件。
- 检查列表,如果满意,则执行 ‘/exlog rollback y [query]’ 或 ‘/el rb y [query]’。
- 要删除条目(不回滚,适用于开启新世界的情况),请使用与回滚相同的方法,但用 ‘rm’/‘remove’ 代替 ‘rb’/‘rollback’。
创建数据提供者和日志源
- 数据提供者和日志源分别可通过继承 ExLogDataProvider 和 ExLogLoggingSource 来实现。
- 请参阅现有实现以获取更多信息。
链接
详细的开发进度可在我的 GitHub 页面 上找到。
请在 BukkitDev 论坛 上讨论该项目。
exLog is a logging plugin for Bukkit, and the official successor to the somewhat popular Log plugin. So what sets it apart from other plugins, like LogBlock and LogEx? It's modular:
We've all had the annoying experience of downloading a plugin and then having to dig through a huge configuration file to enable only the one or two out of 100 features that we actually want. exLog is different. It is a logging platform which, on its own, provides no visible functionality. The functionality of logging sources and data providers is provided by separate modules, in a manner similar to Bukkit and its plugin architecture.
In this way, exLog can remain as lightweight as required without sacrificing functionality for those who desire it.
DO NOT USE THE DOWNLOAD BUTTON ON THE MAIN PAGE
It may not link to the correct file! Follow the instructions in the ‘Basic Installation’ section instead!
Available Modules
- exLog core
- JSON data provider
- SQLite data provider
- basic block logging source (block placement and destruction, bucket use)
Planned Modules
- binary data provider
- redstone logging source (door/button/lever operation)
- mob logging source (creeper/enderman/wither block interaction)
- WorldEdit logging source
- chest logging source
- command logging source
There will, in addition, be a documented API available for anyone who wishes to implement their own logging source or data provider using the exLog framework.
Basic Installation
- Download the latest ‘Core’, ‘JSON’ and ‘Block Logging’ jar files from the Files page. Make sure the ‘Data API Level’s and ‘Block API Level’s match up.
- Recommended: Core 0.3.0, JSON 0.3.0/SQLite 0.3.0, Block Logging 0.3.0.
- Older: Core 0.2.0, JSON 0.2.0/SQLite 0.2.0, Block Logging 0.1.0.
- Put all three jar files in the plugins directory of your Bukkit installation.
- That's it! The plugin should now be preconfigured to log block placements and destructions to the database.json file in your Bukkit directory.
- Lookup history for a block by right-clicking it with a stick or with a bone.
- Permission details can be found in the plugin.yml.
Advanced Installation
- You can install additional modules by downloading and copying the appropriate jar files to the plugins directory of your Bukkit installation.
- These modules will need to be activated in the plugins/ExLog/config.yml file.
- dataProvider takes a single String value, which is the internal plugin name of the Data Provider.
- loggingSources takes a list of String values, which are the internal plugin names of the Logging Sources.
- dateFormat takes a single String value, which is the format of dates used for input and output.
Advanced Usage
- Access advanced exLog commands using ‘/exlog [command] [args]’ or equivalently, ‘/el [command] [args]’.
- Valid commands are ‘help’, ‘info’, ‘test’, ‘query’ and ‘queryu’. The only one you need to know about is query/u.
- query accepts a JSON object as a parameter. Valid keys are ’player’ and ‘origin’ (accepting Strings), ‘x’, ‘y’, ‘z’ and ‘dimension’ (accepting ints), ‘date’ (accepting a long), ‘dateMin’ and ‘dateMax’ (accepting Strings, formatted according to the dateFormat in config.yml), and ‘otherData’ (accepting a JSON object). No keys are required for the command to be successful.
- queryu is the same, but shows UUIDs alongside player names.
- Returns all entries relating to me: /el query {"player":"RunasSudo"}
- Returns all over-world block placements: /el query {"dimension":0,"origin":"ExLogBlockLoggingSource","otherData":{"type":"1"}}
Rollback and Deletion
- Rolling back is still in beta. I am not responsible for any destruction to your worlds or databases as a result of using rollback. I would like to hear about it, though!
- To rollback, first execute ‘/exlog rollback [query]’ or ‘/el rb [query]’.
- The plugin will list all the events to be rolled back according to the query.
- Check the list and, if satisfied, execute ‘/exlog rollback y [query]’ or ‘/el rb y [query]’.
- To delete entries (without rolling back, useful when starting a new world), use the same method as for rolling back, but use ‘rm’/‘remove’ instead of ‘rb’/‘rollback’.
Creating Data Providers and Logging Sources
- Data Providers and Logging Sources can be implemented by subclassing ExLogDataProvider and ExLogLoggingSource, respectively.
- Refer to existing implementations for more information.
Links
In depth progress can be found on my GitHub page.
Please discuss the project on the BukkitDev forums.
评论 0
登录后参与评分
还没有评论,来抢沙发吧