定制 perfocard/flog 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

perfocard/flog

最新稳定版本:v1.0.1

Composer 安装命令:

composer require perfocard/flog

包简介

Laravel wrapper for the Flog binary

README 文档

README

Latest Version on Packagist Total Downloads License

Flog is a Laravel package that provides an interface to generate fake logs. This package is a wrapper around the flog binary created by mingrammer/flog.

Installation

Install the package using Composer:

composer require perfocard/flog

Publish the configuration file:

php artisan vendor:publish --provider="Perfocard\Flog\FlogServiceProvider"

Configuration

After publishing, the configuration file config/flog.php will be available. You can specify the binary path and platform-specific binary paths here:

return [
    'platform' => 'linux-arm64', // Default platform
    'binary_path' => 'vendor/perfocard/flog/bin/{platform}/flog',
];

Update the platform value to match your system's architecture.

Usage

Generate a single log

use Perfocard\Flog\Generator;

$log = Generator::generateOne();

Generate multiple logs

use Perfocard\Flog\Generator;

$logs = Generator::generate(10);

You can also specify a custom format:

$log = Generator::generateOne('apache_common');

Testing

To test this package, ensure that the tests directory is registered in the PHPUnit configuration file of your main project.

Add the following to the phpunit.xml file in your Laravel project:

<testsuites>
    <testsuite name="Perfocard/Flog Tests">
        <directory>vendor/perfocard/flog/tests</directory>
    </testsuite>
</testsuites>

Run the tests:

php artisan test

Contributing

Contributions are welcome! Feel free to submit a pull request or open an issue.

License

This package is open-source software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-06