chrisullyott/php-log

一个简单的日志记录器,以JSON格式存储数据。

v2.0.2 2020-10-03 05:32 UTC

This package is auto-updated.

Last update: 2024-08-29 04:40:50 UTC


README

一个简单的日志记录器,以JSON格式存储数据。

安装

使用Composer

$ composer require chrisullyott/php-log

实例化

设置文件路径。

$log = new ChrisUllyott\Log('data.json');

添加项目

set 通过键存储数据

$log->set('color', 'teal');

检索项目

get 通过键获取项目

$log->get('color');

删除项目

delete 通过键删除项目

$log->delete('key');

reset 删除整个数据库

$log->reset();