Changeset 2224771
- Timestamp:
- 01/09/2020 11:50:59 AM (6 years ago)
- Location:
- debug-log-list/tags/0.1.1.1
- Files:
-
- 2 edited
-
hybridsupply-log.php (modified) (8 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
debug-log-list/tags/0.1.1.1/hybridsupply-log.php
r2224769 r2224771 3 3 * Plugin Name: Debug Log List 4 4 * Description: Extracts errors from your debug.log and groups them into individual items. 5 * Version: 0.1. 1.15 * Version: 0.1.0.1 6 6 * Author: Jay 7 7 * Author URI: https://profiles.wordpress.org/jayhybrid … … 10 10 */ 11 11 defined('HYBRIDSUPPLY_LOG_FILE') or define('HYBRIDSUPPLY_LOG_FILE', __FILE__); 12 defined('HYBRIDSUPPLY_LOG_REGEX_EXTRACT') or define('HYBRIDSUPPLY_LOG_REGEX_EXTRACT', '/\[(\d{1,2}-\w{3}-\d{4} \d{2}:\d{2}:\d{2}).*\]\w*\w*\s*([ \w]*):?\s*(.+)/'); 12 13 13 14 function hybridsupply_log_options_html() { … … 28 29 $logfile_contents = file_get_contents( $logfile ); 29 30 30 preg_match_all( '/\[(\d{1,2}-\w{3}-\d{4} \d{2}:\d{2}:\d{2}).*\]\w*\w*\s*([ \w]*):?\s*(.+)/', $logfile_contents, $output, PREG_SET_ORDER);31 preg_match_all(HYBRIDSUPPLY_LOG_REGEX_EXTRACT , $logfile_contents, $output, PREG_SET_ORDER); 31 32 32 33 for ($i=0; $i < count($output); $i++) { … … 53 54 54 55 case 3: 55 $hash = hash( ' sha256', $part );56 $hash = hash( 'crc32', $part ); 56 57 57 58 if ( ! in_array($hash, $log_hashes) ) { … … 59 60 } 60 61 61 /* preg_match('/(\/[\/\w\W]+php)/', $part, $match); */62 /* $log[$i]->folder = $match[0]; */63 62 $log[$i]->folder =''; 64 63 $log[$i]->message = $part; … … 224 223 225 224 for ($i=0; $i < count($units1024); $i++) { 226 $current_size1024 = round($filesize / pow(1024, $i + 1), 0);227 $current_size1000 = round($filesize / pow(1000, $i + 1), 0);225 $current_size1024 = round($filesize / pow(1024, $i + 1), 2); 226 $current_size1000 = round($filesize / pow(1000, $i + 1), 2); 228 227 229 228 $byte = $current_size1024 == 1 ? 'byte' : 'bytes'; … … 348 347 $logfile_contents = file_get_contents( $logfile ); 349 348 350 preg_match_all( '/\[(\d{1,2}-\w{3}-\d{4} \d{2}:\d{2}:\d{2}).*\] ([\w \(\)]*):?\s*(.+)/', $logfile_contents, $output, PREG_SET_ORDER);349 preg_match_all(HYBRIDSUPPLY_LOG_REGEX_EXTRACT , $logfile_contents, $output, PREG_SET_ORDER); 351 350 352 351 for ($i=0; $i < count($output); $i++) { … … 360 359 361 360 case 3: 362 $hash = hash( ' sha256', $part );363 364 if ( ! in_array($hash, $log_hashes) ) {361 $hash = hash( 'crc32', $part ); 362 363 if ( ! in_array($hash, $log_hashes) ) { 365 364 $log_hashes[] = $hash; 366 365 } -
debug-log-list/tags/0.1.1.1/readme.txt
r2224767 r2224771 32 32 == Changelog == 33 33 34 = 0.1.1.1 = 35 36 * Updated RegEx for better Log extraction 37 38 = 0.1.0.1 = 39 40 * Bugfixes 41 34 42 = 0.1.0.0 = 35 43
Note: See TracChangeset
for help on using the changeset viewer.