Changeset 3246858
- Timestamp:
- 02/26/2025 06:56:41 AM (11 months ago)
- File:
-
- 1 edited
-
pz-linkcard/trunk/pz-linkcard.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pz-linkcard/trunk/pz-linkcard.php
r3246852 r3246858 2588 2588 } 2589 2589 2590 // デバグ用の文字列表示 2591 private function pz_OutputLOG($function, $user_message = null, $separate = false ) { 2592 if (is_dir(DIR_DEBUG ) ) { 2593 $filename = DIR_DEBUG.$this->slug.'_'.date('Ymd', current_time('timestamp', false ) ).'.log'; 2594 if (function_exists('microtime' ) && function_exists('wp_date') ) { 2595 $timestamp = microtime(true ); 2596 $dt = intval($timestamp ); 2597 $ms = substr(intval($timestamp * 1000 ), -3, 3 ); 2598 $timestamp = wp_date('Y-m-d H:i:s', $dt ).'.'.$ms; 2599 } else { 2600 $timestamp = date('Y-m-d H:i:s', current_time('timestamp', false ) ); 2601 } 2602 $count = sprintf('%03d', $this->test_count++ ); 2603 $message = ($separate ? PHP_EOL : null ).$timestamp.' '.$count.' ['.$function.'] '.$user_message.(mb_substr($user_message, -1, 1) == PHP_EOL ? null : PHP_EOL ); 2604 $result = file_put_contents($filename, $message, FILE_APPEND ); 2605 return $result; 2606 } 2607 } 2608 2590 2609 // 日付・時刻の書式変換 2591 2610 private function pz_Date($format, $value ) { … … 2705 2724 // 管理画面時の設定(スクリプトの追加) 2706 2725 public function action_admin_print_scripts() { 2707 if ($this->options['survey-mode'] ) { $this->pz_OutputLOG(__FUNCTION__ ); }2726 // if ($this->options['survey-mode'] ) { $this->pz_OutputLOG(__FUNCTION__ ); } 2708 2727 2709 2728 } … … 2820 2839 return $log; 2821 2840 } 2822 2823 // デバグ用の文字列表示2824 private function pz_OutputLOG($function, $user_message = null, $separate = false ) {2825 if (is_dir(DIR_DEBUG ) ) {2826 $filename = DIR_DEBUG.$this->slug.'_'.date('Ymd', current_time('timestamp', false ) ).'.log';2827 // if (function_exists('microtime' ) ) {2828 // $timestamp = microtime(true );2829 // $timestamp = wp_date('Y-m-d H:i:s', $timestamp ).'.'.substr(intval($timestamp * 1000 ), -3, 3 );2830 // } else {2831 $timestamp = date('Y-m-d H:i:s', current_time('timestamp', false ) );2832 // }2833 $count = sprintf('%03d', $this->test_count++ );2834 $message = ($separate ? PHP_EOL : null ).$timestamp.' '.$count.' ['.$function.'] '.$user_message.(mb_substr($user_message, -1, 1) == PHP_EOL ? null : PHP_EOL );2835 $result = file_put_contents($filename, $message, FILE_APPEND );2836 return $result;2837 }2838 }2839 2841 } 2840 2842 $class_pz_linkcard = new class_pz_linkcard;
Note: See TracChangeset
for help on using the changeset viewer.