amattu2/event-logger 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

amattu2/event-logger

最新稳定版本:v1.0.0

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

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0
  • 更新时间: 2023-03-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固