定制 orpheusnet/logchecker 二次开发

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

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

orpheusnet/logchecker

Composer 安装命令:

composer require orpheusnet/logchecker

包简介

Logchecker for validating logs generated from supported ripping programs (like EAC and XLD)

README 文档

README

A CD rip logchecker, used for analyzing the generated logs for any problems that would potentially indicate a non-perfect rip was produced. Of course, just because a log doesn't score a perfect 100% does not mean that the produced rip isn't bit perfect, it's just less likely. This library should work on any OS where PHP and Python are supported.

While this library will analyze most parts of a log, unfortunately it cannot properly validate the checksums for all types of logs. This is due to creators of these programs making their logchecker closed source and involves some amount of custom mathematical work to produce it. Therefore, we have to fallback on external methods to validate the checksums of EAC and XLD. If the logchecker detects that we do not have the necessary programs, then we will just skip this external step and assume the checksum is valid. For setting up the necessary programs to validate the checksum, see below for the given program you care about.

Requirements

  • PHP 8.1+

Optional Requirements

pip3 install cchardet eac-logchecker xld-logchecker

Standalone

Installation

Install via composer:

composer global require orpheusnet/logchecker

Alternatively, go to our releases and grab the logchecker.phar file. Download this file, and then it can executed via CLI by running php logchecker.phar. If you chmod +x the file, then it should be directly executable (i.e. ./logchecker.phar). To then install it globally, run:

mv logchecker.phar /usr/local/bin/logchecker
chmod +x /usr/local/bin/logchecker

Usage

$ logchecker list
Logchecker 0.11.1

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  analyze    [analyse] analyze log file
  decode     Decodes log from whatever encoding into UTF-8
  help       Displays help for a command
  list       Lists commands
  translate  Translates a log into english

Main usage is through the analyze command, e.g.:

$ logchecker analyze --no_text path/to/file.log
Ripper  : EAC
Version : 1.0 beta 3
Language: en
Score   : 59
Checksum: checksum_ok
Details :
    Could not verify gap handling (-10 points)
    Could not verify id3 tag setting (-1 point)
    Range rip detected (-30 points)

Code

<?php

$logchecker = new OrpheusNET\Logchecker\Logchecker();
$logchecker->add_file('path/to/file.log');
list($score, $details, $checksum_state, $log_text) = $logchecker->parse();

Library Usage

Installation

composer require orpheusnet/logchecker

Usage

<?php

require __DIR__ . '/vendor/autoload.php';

use OrpheusNET\Logchecker\Logchecker;

$logchecker = new Logchecker();
$logchecker->newFile('/path/to/log/file');
$logchecker->parse();
print('Ripper   : ' . $logchecker->getRipper() . "\n");
print('Version  : ' . $logchecker->getRipperVersion() . "\n");
print('Score    : ' . $logchecker->getScore() . "\n");
print('Checksum : ' . $logchecker->getChecksumState() . "\n");
print("\nDetails:\n");
foreach ($logchecker->getDetails() as $detail) {
    print("  {$detail}\n");
}
print("\nLog Text:\n\n{$logchecker->getLog()}");

Building

To build your own phar, see the release.yml workflow, but the gist is:

  1. Clone this repo and enter repo
  2. Install box
  3. Run box compile
  4. Get logchecker.phar in root of repo

orpheusnet/logchecker 适用场景与选型建议

orpheusnet/logchecker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.27k 次下载、GitHub Stars 达 69, 最近一次更新时间为 2018 年 11 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 orpheusnet/logchecker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 orpheusnet/logchecker 我们能提供哪些服务?
定制开发 / 二次开发

基于 orpheusnet/logchecker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 69
  • Watchers: 7
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: Unlicense
  • 更新时间: 2018-11-24