amattu2/event-logger
Composer 安装命令:
composer require amattu2/event-logger
包简介
A lightweight, basic PHP 7+ event message logger that eases the workload of writing and generating timestamped events.
README 文档
README
This is a basic PHP event logger class for writing HTML based event logs.
Usage
addEvent
This function is used to add a new event log. Optionally override the default timestamp (now).
/** * Add a new event to the log * * @param string $text event content * @param ?DateTime $timestamp event timestamp * @return boolean success * @author Alec M. */ public function addEvent(string $text, \DateTime $timestamp = null) : bool
getStartTime
This function returns the exact DateTime for the timestamp of the first event added.
/** * Return first event timestamp * * @return \DateTime */ public function getStartTime() : \DateTime
getEndTime
This function returns the timestamp as a DateTime for the last time an event was added to the log.
/** * Return last event timestamp * * @return \DateTime */ public function getEndTime() : \DateTime
getEvents
This returns the event log as an array.
/** * Return collection of events * * @return array */ public function getEvents() : array
getEventsTable
This returns the event log formatted as an HTML table. Optionally override the DateTime format for events.
/** * Return the event list as a HTML table * * @param string $date_format DateTime format string * @return string HTML table */ public function getEventsTable(string $date_format = "Y-m-d G:i:s") : string
Requirements & Dependencies
PHP 7+ or above
amattu2/event-logger 适用场景与选型建议
amattu2/event-logger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 03 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 amattu2/event-logger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 amattu2/event-logger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0
- 更新时间: 2023-03-09