LoggingPlugin
Provides unified logging functionality
模組介紹 作者原文
Logger Plugin
This unofficial TaleSpire plugin for adding unified logging to other plugins.
This plugin, like all others, is free but if you want to donate, use:
Install
Install using R2ModMan or similar.
Usage
The use of this plugin is passive. It is a dependency plugin which allows other plugins to perform
logging functionality in a consistent manner.
User Configuration
The plugin has two options in terms of plugin logging levels. Many plugins have a configuration for
the logging level in which case it can be convenient to be able to configure the logging level from
the plugin's configuration whereas in other cases it can be convenient to be able to set the logging
levels for all plugins in a single unified source such as the logger configuration. To address This
the logger configuration has the following setting:
`Allow Plugins Logging Level (Default true`)
When this setting is set to true, the logging levels configured in the logger configuration are used
as the starting logging level but plugins can change the logging level at runtime. This allows The
plugins to set the logging level based on their own configuration. Any plugin that does not set its
logging level will end up using the value configured in the logger.
When this settings is set to false, all request by plugins to change their logging levels will be
ignored and the configured logging level in the logger configuration will be used instead.
`Plugin Logging Level (Default \*:info`)
The logger configuration can configure different logging levels for each plugin. This setting is a
comma delimited list of plugins with their desired logging level. The plugin name (as it appears in
the log) is seperated from the logging level by a colon. The `\*` entry should always be present
and it represents the logging level for all plugins that have not been listed. For example,
"AssetDataPlugin:debug,\*:info" would set the logging level for the Asset Data Plugin to debug while
setting the logging level for all other plugins to info.
`Logger Own Logging Level (Default error`)
This setting determins the logger plugin's own logging level. It is separated from the plugin list
since these log messages are not generated by others but are instead geenrated by the logger itself.
Typically this logging level should not need to be set high unless a problem with the logger itself
is suspected.
`Log Entry Format (Default {TIMESTAMP} - {LEVEL} - {NAME} - {CONTENT}`)
This setting determines the content of the log. The setting can make use of a number of place holders
to automatically insert various information into the log along with the log message. The following
place holders are supported:
{NAME!} = Name of the logging plugin
{NAME} = Name of the logging plugin padded to the specified length (see below)
{LEVEL!} = Severity of the message (e.g. error, warning, info, debug, trace)
{LEVEL} = Severity of the message padded to the longest entry (i.e. warning)
{LEVEL#} = Severity of the message expressed as a numeric value
{TIMESTAMP} = Date and time that the message was logged
{DATE} = Date in YYYY.MM.DD format when the message was logged
{TIME} = Time in HH:MM:DD.SSS format when the message was logged
{CONTENT} = The message to be logged
`Length Of Plugin Name (Default 20`)
This setting indicated the length to which the plugin name is padded when using {NAME}. Unlike the
the severity levels which are an enumeration and thus the longest possible entry can be determined
so that all entries can be padded to that length, the plugin name is not predictable since a new
plugin can be added at any time with a longer name. As such the padding for the plugin name is set
using this setting.
Plugin Creators
The Logging Plugin is intended to be as simple as possible. In its simplest use case, you can use
it without any initialization. To use it, like any other library, you need to add a project reference
to the Logging Plugin and then add a
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。