このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
apricot:usage:ja:errors-logging [2020/09/09 09:52] y2sunlight [DebugBarクラス] |
apricot:usage:ja:errors-logging [2020/09/10 18:02] (現在) y2sunlight [アセットファイル] |
||
---|---|---|---|
行 29: | 行 29: | ||
^メソッド^機能^ | ^メソッド^機能^ | ||
- | |void emergency(string $message, array $context = [])|emergencyレベルのログ| | + | |emergency(string $message, array $context = [])|emergencyレベルのログ| |
- | |void alert(string $message, array $context = [])|alertレベルのログ| | + | |alert(string $message, array $context = [])|alertレベルのログ| |
- | |void critical(string $message, array $context = [])|criticalレベルのログ| | + | |critical(string $message, array $context = [])|criticalレベルのログ| |
- | |void error(string $message, array $context = [])|errorレベルのログ| | + | |error(string $message, array $context = [])|errorレベルのログ| |
- | |void warning(string $message, array $context = [])|warningレベルのログ| | + | |warning(string $message, array $context = [])|warningレベルのログ| |
- | |void notice(string $message, array $context = [])|noticeレベルのログ| | + | |notice(string $message, array $context = [])|noticeレベルのログ| |
- | |void info(string $message, array $context = [])|infoレベルのログ| | + | |info(string $message, array $context = [])|infoレベルのログ| |
- | |void debug(string $message, array $context = [])|debugレベルのログ| | + | |debug(string $message, array $context = [])|debugレベルのログ| |
- | |void log($level, string $message, array $context = [])|任意レベルのログ| | + | |log($level, |
使用例: | 使用例: | ||
行 80: | 行 80: | ||
==== DebugBarクラス ==== | ==== DebugBarクラス ==== | ||
- | '' | + | '' |
使用法: **DebugBar:: | 使用法: **DebugBar:: | ||
行 88: | 行 88: | ||
|render(): | |render(): | ||
|getCollector(string $name=" | |getCollector(string $name=" | ||
+ | |||
+ | こららのメソッドの内、'' | ||
\\ | \\ | ||
==== Debugクラス ==== | ==== Debugクラス ==== | ||
- | 実際にデバッグライトを行うクラスです。機能的にはDebugBarのコレクター( DataCollectorInterface )と同じですが、ロギングと同様にPSR-3に従って以下のように使います。以下の関数は基本的にvar_dump()と同じように変数の内容をダンプします (これらの関数の違いは単に出力レベルが付いているだけです)。'' | + | '' |
使用法: ** Debug:: | 使用法: ** Debug:: | ||
^メソッド^機能^ | ^メソッド^機能^ | ||
- | |void emergency(string | + | |emergency($message, |
- | |void alert(string | + | |alert($message, |
- | |void critical(string | + | |critical($message, |
- | |void error(string | + | |error($message, |
- | |void warning(string | + | |warning($message, |
- | |void notice(string | + | |notice($message, |
- | |void info(string | + | |info($message, |
- | |void debug(string | + | |debug($message, |
- | |void log($level, | + | |log($level, |
+ | |||
+ | 使用例: | ||
+ | |||
+ | <code php> | ||
+ | use Apricot\Debug; | ||
+ | Debug:: | ||
+ | </ | ||
\\ | \\ | ||
行 132: | 行 141: | ||
</ | </ | ||
- | * debug --- デバッグモード(既定値は 環境変数APP_DEBUGの値) | + | '' |
- | * renderer.base_url --- DebugBarの公開用リソースのURL | + | |
- | * renderer.base_path --- DebugBarの公開用リソースのサーバ内ディレクトリ | + | '' |
- | * renderer.initialize --- 初期化コードをレンダリングするか否か(既定値はtrue) | + | |
- | * renderer.stacked_data --- スタックデータをレンダリングするか否か(既定値はtrue) | + | * '' |
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== アセットファイル ==== | ||
+ | |||
+ | 設定値の '' | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | デバッグ出力で使用するアセットファイルは、以下のディレクトリーに保存されているので、この下の全てのファイルとディレクリーを上記の場所にコピーして下さい。 | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | 結果的に手動の場合のアセットファイルの配置は以下のようになります: | ||
+ | |||
+ | {{fa> | ||
+ | < | ||
+ | vendor/ | ||
+ | widgets/ | ||
+ | debugbar.css | ||
+ | debugbar.js | ||
+ | openhandler.css | ||
+ | openhandler.js | ||
+ | widgets.css | ||
+ | widgets.js | ||
+ | </ | ||
\\ | \\ |