25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.9 KiB

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