[wordpress插件] Custom Logging Service自定义日志服务

wordpress 插件 文章 2020-04-08 14:20 471 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin is derived from the no longer supported

此插件源自不再受支持的

WordPress Logging Service.

WordPress日志记录服务

Despite that it is not compatiple with it, and there is no upgrade path from one

尽管它不兼容,并且没有从它升级的路径

to the other.

到另一个。

Features

功能

    • No log entries generated by the plugin itself, all come from external API calls
    • 插件本身未生成任何日志条目,全部来自外部API调用

    • Organisation of log entries in freetext categories
    • 自由文本类别的日志条目的组织

    • Severity levels
    • 严重级别

    • Freetext log messages
    • 自由文本日志消息

    • Entries can be marked as seen and then filtered from being displayed again
    • 可以将条目标记为可见,然后过滤以免再次显示

    • Filtering by minimum severity level
    • 按最低严重性级别进行过滤

    • Sort by date, category, user name, severity or blog name (in Multisite installations)
    • 按日期,类别,用户名,严重性或博客名称排序(在多站点安装中)

    • Access to the log page can be granted by user role
    • 可以通过用户角色授予对日志页面的访问权限

    API

    API

    Constants

    常量

    Check to test if the plugin is active:

    检查插件是否处于活动状态:

    CLGS = true

      CLGS = true

    Defined severity levels:

    定义的严重性级别:

    CLGS_NOSEVERITY = 0

      CLGS_NOSEVERITY = 0

    CLGS_INFO = 1

    CLGS_INFO = 1

    CLGS_NOTICE = 2

    CLGS_NOTICE = 2

    CLGS_WARNING = 3

    CLGS_WARNING = 3

    CLGS_ERROR = 4

    CLGS_ERROR = 4

    CLGS_FATALERROR = 5

    CLGS_FATALERROR = 5

    Functions

    功能

    clgs_is_registered ( $category )

      clgs_is_registered($ category)

      • string $category
      • 字符串$ category

      returns true if $category is registered.

      如果注册了 $ category ,则

      返回 true

      clgs_register ( $category, $description )

        clgs_register($ category,$ description)

      registers $category as a log category.

      $ category 注册为日志类别。

      $description will be shown in the

      $ description 将显示在

      management page.

      管理页面。

      It is good practice to use unique categories for each plugin that publishes

      最好对发布的每个插件使用唯一的类别

      log messages.

      日志消息。

        • string $category At most 190 (unicode) characters
        • 字符串$ category 最多190个(unicode)字符

        • string $description can contain HTML same as comments (filtered by
            

        • 字符串$ description 可以包含与注释相同的HTML(由
          过滤  

          wp_kses_data)

        • wp_kses_data)

        returns false if the category is already registered or it is too long.

        返回 false (如果类别已经注册或类别太长)。

        clgs_clear ( $category )

          clgs_clear($ category)

        deletes all log entries of $category.

        删除 $ category 的所有日志条目。

          • string $description existing category
          • 字符串$ description 现有类别

          returns number of deleted entries or false if action failed.

          返回已删除条目的数量,如果操作失败,则返回 false

          clgs_unregister( $category );

            clgs_unregister($ category);

          deletes all log entries and then removes $category.

          删除所有日志条目,然后删除 $ category

            • string $description existing category
            • 字符串$ description 现有类别

            returns false if false if action failed.

            如果操作失败,则

            返回 false 如果为false。

            clgs_log( $category, $text, $severity = null, $user = null, $blog_id = null, $date = null );

              clgs_log($ category,$ text,$ severity = null,$ user = null,$ blog_id = null,$ date = null);

            writes a new log entry in the specified category

            在指定的类别中写入新的日志条目

              • string $description a registered category name
              • 字符串$ description 注册的类别名称

              • string $text the logged message, can contain HTML same as comments (filtered

              • string $ text 记录的消息,可以包含与注释相同的HTML(已过滤

                by wp_kses_data)

              • 通过 wp_kses_data

              • int $severity one of defined severity levels (see above);

              • int $ severity 定义的严重性级别之一(请参见上文);

                if missing defaults to
                  

                如果丢失,则默认为
                  

                CLGS_NOCATEGORY

              • CLGS_NOCATEGORY

              • int |

              • int |

                string |

                字符串

                WP_User $user user id, slug or WP user object are aceptable;

                可以接受WP_User $ user 用户ID,slug或WP用户对象;

                if missing

                如果丢失

                defaults to current user (or a placeholder if none is logged in)

              • 默认为当前用户(如果未登录,则为占位符)

              • int $blog_id blog id;

              • int $ blog_id 博客ID;

                if missing defaults to current blog

              • 如果缺少默认值,则为当前博客

              • int |

              • int |

                double |

                双|

                string $date a UNIX timestamp or a string recognized by strtotime();

                字符串$ date UNIX时间戳或 strtotime();
                识别的字符串

                if missing defaults to current time

              • 如果缺少默认值,则为当前时间

              returns false if entering the log failed.

              如果输入日志失败,

              返回 false

安装步骤

    1. Install from Plugins -> Add New
    2. 插件安装->添加新

    3. Or download the .zip and extract to wp-content/plugins
    4. 或下载.zip并解压缩到 wp-content / plugins

    5. Activate the plugin from the Plugins menu.

    6. 插件菜单激活插件。

      In Multisite installations, feel free

      在多站点安装中,随意

      to activate as a network plugin or to leave it to individual blogs.

    7. 激活作为网络插件或将其留给各个博客。

    8. Go to Settings -> Custom Logging Service for the next steps
    9. 转到设置->自定义日志记录服务进行下一步

    Settings

    设置

      • Minimum severity for notification: You will see the number of unseen log entries

      • 最低通知严重性:您将看到看不见的日志条目数量

        of that level or above next to the menu entry for the log page.

      • 级别或更高级别(位于日志页面的菜单项旁边)。

      • Default minimum severity filter: Which severity levels you will see in the log page.

      • 默认的最低严重性过滤器::您将在日志页面中看到哪些严重性级别。

        You can change this filter later on the page.

      • 您可以稍后在页面上更改此过滤器。

      • Roles that can manage Custom Logs: Decide who can see and interact with the log page.
      • 可以管理自定义日志的角色:确定哪些人可以查看日志页面并与之交互。

      • Log entries per page: Set the number of entries per page.
      • 每页的日志条目:设置每页的条目数量。

      Generating Log messages

      生成日志消息

      This plugin does not generate any log messages by itself.

      此插件本身不会生成任何日志消息。

      You need other plugins to

      您需要其他插件来

      interact with it through the API;

      通过API与之交互;

      see the API section for details.

      有关详细信息,请参见API部分。

下载地址
https://downloads.wordpress.org/plugin/custom-logging-service.zip
-EOF-

AI助手支持GPT4.0