選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # Logchecker
  2. A CD rip logchecker, used for analyzing the generated logs for any problems that would potentially
  3. indicate a non-perfect rip was produced. Of course, just because a log doesn't score a perfect 100%
  4. does not mean that the produced rip isn't bit perfect, it's just less likely. This library should work
  5. on any OS where PHP and Python are supported.
  6. While this library will analyze most parts of a log, unfortunately it cannot properly validate the checksums
  7. for all types of logs. This is due to creators of these programs making their logchecker closed source
  8. and involves some amount of custom mathematical work to produce it. Therefore, we have to fallback on
  9. external methods to validate the checksums of EAC and XLD. If the logchecker detects that we do not have
  10. the necessary programs, then we will just skip this external step and assume the checksum is valid. For
  11. setting up the necessary programs to validate the checksum, see below for the given program you care about.
  12. ## Requirements
  13. * PHP 7.0+
  14. ## Optional Requirements
  15. * Python 3.5+
  16. * [cchardet](https://github.com/PyYoshi/cChardet) (or [chardet](https://github.com/chardet/chardet))
  17. * [eac_logchecker.py](https://github.com/OPSnet/eac_logchecker.py)
  18. * [xld_logchecker.py](https://github.com/OPSnet/xld_logchecker.py)
  19. ```bash
  20. pip3 install cchardet eac-logchecker xld-logchecker
  21. ```
  22. ## Standalone
  23. ### Installation
  24. Go to our [releases](https://github.com/OPSnet/Logchecker/releases) and grab the logchecker.phar
  25. file. Download this file, and then it can executed via CLI by running `php logchecker.phar`.
  26. Alternatively, if you `chmod +x logchecker.phar`, it can be executed directly by doing `./logchecker.phar`.
  27. To install it globally, run:
  28. ```bash
  29. mv logchecker.phar /usr/local/bin/logchecker
  30. chmod +x /usr/local/bin/logchecker
  31. ```
  32. ### Usage
  33. ```
  34. $ logchecker --help
  35. Usage:
  36. analyze [options] [--] <file>
  37. Arguments:
  38. file Log file to analyze
  39. Options:
  40. --output Print the HTML log text
  41. -h, --help Display this help message
  42. -q, --quiet Do not output any message
  43. -V, --version Display this application version
  44. --ansi Force ANSI output
  45. --no-ansi Disable ANSI output
  46. -n, --no-interaction Do not ask any interactive question
  47. -file, --out=OUT File to write HTML log text to
  48. -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
  49. Help:
  50. This command analyzes a log file
  51. $ logchecker tests/logs/wgdbcm.log
  52. Score : 57
  53. Checksum: checksum_missing
  54. Details :
  55. [Notice] Translated log from Русский (Russian) to English.
  56. EAC version older than 0.99 (-30 points)
  57. Could not verify read mode (-1 point)
  58. Could not verify read offset (-1 point)
  59. Could not verify null samples
  60. Could not verify gap handling (-10 points)
  61. Could not verify id3 tag setting (-1 point)
  62. ```
  63. ### Code
  64. ```php
  65. <?php
  66. $logchecker = new OrpheusNET\Logchecker\Logchecker();
  67. $logchecker->add_file('path/to/file.log');
  68. list($score, $details, $checksum_state, $log_text) = $logchecker->parse();
  69. ```
  70. ## Library Usage
  71. ### Installation
  72. ```bash
  73. composer require orpheusnet/logchecker
  74. ```
  75. ### Usage
  76. ```php
  77. <?php
  78. require __DIR__ . '/vendor/autoload.php';
  79. use OrpheusNET\Logchecker\Logchecker;
  80. $logchecker = new Logchecker();
  81. $logchecker->newFile('/path/to/log/file');
  82. $logchecker->parse();
  83. print('Ripper : ' . $logchecker->getRipper() . "\n");
  84. print('Version : ' . $logchecker->getRipperVersion() . "\n");
  85. print('Score : ' . $logchecker->getScore() . "\n");
  86. print('Checksum : ' . $logchecker->getChecksumState() . "\n");
  87. print("\nDetails:\n");
  88. foreach ($logchecker->getDetails() as $detail) {
  89. print(" {$detail}\n");
  90. }
  91. print("\nLog Text:\n\n{$logchecker->getLog()}");
  92. ```
  93. ## Building
  94. To build your own phar, you can checkout this repository, and then
  95. run the `bin/compile` script. To do this, run the following commands:
  96. ```bash
  97. git clone https://github.com/OPSnet/Logchecker
  98. cd Logchecker
  99. composer install
  100. php -d phar.readonly=0 bin/compile
  101. ```