krubio/perfect-logger 问题修复 & 功能扩展

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

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

krubio/perfect-logger

最新稳定版本:v0.1.0

Composer 安装命令:

composer require krubio/perfect-logger

包简介

A PSR-3 compliant logging library

README 文档

README

codecov

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

Coverage Maintainability Rating Code Smells Technical Debt Quality Gate Status Reliability Rating

Duplicated Lines (%) Vulnerabilities Bugs Security Rating

Perfect Logger

Perfect Logger is a PSR-3 compliant logging library for PHP. It provides an easy way to log messages to a file.

Installation

Install via composer:

composer require krubio/perfect-logger

Usage

<?php

require 'vendor/autoload.php';

use PerfectApp\Logger\FileLogger;

// Initialize the logger
$logger = new FileLogger('/path/to/your/logfile.log');

// Log some messages
$logger->emergency('This is an emergency message');
$logger->alert('This is an alert message');
$logger->critical('This is a critical message');
$logger->error('An error occurred', ['errorCode' => 123]);
$logger->warning('This is a warning message');
$logger->notice('This is a notice message');
$logger->info('This is an informational message');
$logger->debug('This is a debug message');

$logger->error('An error occurred', [
    'user_id' => 10,
    'url' => 'https://example.com',
    'data' => 'Important Data'
]);

Log Levels

The logger supports the following log levels:

  • Emergency: system is unusable
  • Alert: action must be taken immediately
  • Critical: critical conditions
  • Error: error conditions
  • Warning: warning conditions
  • Notice: normal but significant condition
  • Info: informational messages
  • Debug: debug-level messages

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-02