Ground Sunlight

Windowsで作る - PHPプログラミングの開発環境

ユーザ用ツール

サイト用ツール


apricot:usage:ja:errors-logging

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
apricot:usage:ja:errors-logging [2020/09/09 11:12]
y2sunlight [ロギング]
apricot:usage:ja:errors-logging [2020/09/10 18:02] (現在)
y2sunlight [アセットファイル]
行 94: 行 94:
  
 ==== Debugクラス ==== ==== Debugクラス ====
-実際にデバッグライトを行うクラスです。機能的にはDebugBarのコレクター( DataCollectorInterface )と同じですが、ロギングと同様にPSR-3に従って以下のように使います。以下の関数は基本的にvar_dump()と同じように変数の内容をダンプします (これらの関数の違いは単に出力レベルが付いているだけです)。''Debug::debug($this)'' とすれば自分のメンバ変数が全てダンプされます。+''Debug'' クラスは、実際にデバッグ出力を行うクラスです。機能的にはDebugBarのコレクター( DataCollectorInterface )と同じですが、ロギングと同様にPSR-3に従って以下のように使います。以下の関数は基本的に ''var_dump()'' と同じように変数の内容をダンプします (これらの関数の違いは単に出力レベルが付いているだけです)。''Debug::debug($this)'' とすれば自分のメンバ変数が全てダンプされます。
  
 使用法: ** Debug::{メソッド} ** 使用法: ** Debug::{メソッド} **
  
 ^メソッド^機能^ ^メソッド^機能^
-|emergency(string $message, array $context = [])|emergencyレベル| +|emergency($message, array $context = [])|emergencyレベル| 
-|alert(string $message, array $context = [])|alertレベル| +|alert($message, array $context = [])|alertレベル| 
-|critical(string $message, array $context = [])|criticalレベル| +|critical($message, array $context = [])|criticalレベル| 
-|error(string $message, array $context = [])|errorレベル| +|error($message, array $context = [])|errorレベル| 
-|warning(string $message, array $context = [])|warningレベル| +|warning($message, array $context = [])|warningレベル| 
-|notice(string $message, array $context = [])|noticeレベル| +|notice($message, array $context = [])|noticeレベル| 
-|info(string $message, array $context = [])|infoレベル| +|info($message, array $context = [])|infoレベル| 
-|debug(string $message, array $context = [])|debugレベル| +|debug($message, array $context = [])|debugレベル| 
-|log($level, string $message, array $context = [])|任意レベル|+|log($level, $message, array $context = [])|任意レベル| 
 + 
 +使用例: 
 + 
 +<code php> 
 +use Apricot\Debug; 
 +Debug::debug($this); 
 +</code>
  
 \\ \\
行 134: 行 141:
 </code> </code>
  
-  * debug --- デバッグモード(既定値は 環境変数APP_DEBUG) +''debug''デバッグ出力の有効性を指するブールです。この値が真の場合、デバッグ出力が有効になります。初期設定[[apricot:usage:ja:config#環境設定|環境変数]] ''APP_DEBUG'' と同じです。 
-  * renderer.base_url --- DebugBarの公開用リソースURL + 
-  * renderer.base_path --- DebugBarの公開用リソースのサーバ内ディレクトリ +''renderer'' 要素には以下の子要素があります。 
-  * renderer.initialize --- 初期化コードをレンダリングするか否か(既定値はtrue) + 
-  * renderer.stacked_data --- スタックデータをレンダリングするか否か(既定値はtrue)+  * ''auto_assets'' --- 使用するアセットファイルの自動作成を指定します。 
 +  * ''base_url'' --- DebugBarのアセットのベースURLを指定します。 
 +  * ''base_path'' --- DebugBarのアセットのサーバ内のベースパスを指定します。 
 +  * ''initialize'' --- 初期化コードをレンダリングするか否かを指します。(デフォルト値はtrue) 
 +  * ''stacked_data'' --- スタックデータをレンダリングするか否かを指します。(デフォルト値はtrue) 
 + 
 +''auto_assets'' が true の場合、アプリケーションの初期化時に使用するリソースファイルを自動的に公開用ディレクトリーに作成します。''auto_assets'' が falseの場合は、手動でリソースファイルを作成して下さい。''base_url'' と ''base_path'' は手動の場合に指定します。 
 + 
 +''initialize''と''stacked_data''は、デバッグ出力が有効( ''<nowiki>'debug' => true</nowiki>'' )の場合に効果があり、通常は、true のままで使用して下さい。 
 + 
 +\\ 
 + 
 +==== アセットファイル ==== 
 + 
 +設定値の ''auto_assets'' がtureの場合は、アプリケーションの初期化時に自動で以下のディレクトリにのアセットファイルが作成されます。 
 + 
 +<code> 
 +/your-app-path/var/debugbar 
 +</code> 
 + 
 +''auto_assets'' がfalseの場合は、手動で以下に場所にアセットファイルを配置するように初期設定されています。 
 + 
 +<code> 
 +/your-app-path/resources/debugbar 
 +</code> 
 + 
 +デバッグ出力で使用するアセットファイルは、以下のディレクトリーに保存されているので、この下の全てのファイルとディレクリーを上記の場所にコピーして下さい。 
 + 
 +<code> 
 +/your-project/vender/maximebf/debugbar/src/DebugBar/Resources/ 
 +</code> 
 + 
 +結果的に手動の場合のアセットファイルの配置は以下のようになります: 
 + 
 +{{fa>folder-open-o}} ** /your-app-path/resources/debugbar ** 
 +<code> 
 +vendor/ 
 +widgets/ 
 +debugbar.css 
 +debugbar.js 
 +openhandler.css 
 +openhandler.js 
 +widgets.css 
 +widgets.js 
 +</code>
  
 \\ \\
apricot/usage/ja/errors-logging.1599617522.txt.gz · 最終更新: 2020/09/09 11:12 by y2sunlight