Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

README.md 3.8 KiB

6 lat temu
6 lat temu
6 lat temu
6 lat temu
6 lat temu
6 lat temu
6 lat temu
6 lat temu
6 lat temu
6 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. ```
  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: false
  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. ```
  66. <?php
  67. $logchecker = new OrpheusNET\Logchecker\Logchecker();
  68. $logchecker->add_file('path/to/file.log');
  69. list($score, $details, $checksum, $log_text) = $logchecker->parse();
  70. ```
  71. ## Library Usage
  72. ### Installation
  73. ```
  74. $ composer require orpheusnet/logchecker
  75. ```
  76. ### Usage
  77. ```
  78. use OrpheusNET\Logchecker\Logchecker();
  79. $logchecker = new Logchecker();
  80. $logchecker->new_file('/path/to/log/file');
  81. list($score, $details, $checksum, $log_text) = $logchecker->parse();
  82. print('Score: ' . $score . "\n");
  83. print('Checksum: ' . ($checksum ? 'true' : 'false') . "\n");
  84. print("\nDetails:\n");
  85. foreach ($details as $detail) {
  86. print(" {$detail}\n");
  87. }
  88. print("\nLog Text:\n{$log_text}");
  89. ```
  90. ## Building
  91. To build your own phar, you can checkout this repository, and then
  92. run the `bin/compile` script. To do this, run the following commands:
  93. ```
  94. git clone https://github.com/OPSnet/Logchecker
  95. cd Logchecker
  96. composer install
  97. php -d phar.readonly=0 /bin/compile
  98. ```