You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If run within a web server, it will enclose with `<pre>`
87
+
88
+
`Debug::quit();` will do `::out()` then `exit`.
89
+
90
+
91
+
92
+
93
+
### Logging
94
+
95
+
You can configure the log and err file paths, or allow them to be automatically determined. The names will be `log` and `err`, and the folder will be determined upon:
96
+
- if `$_ENV['root_path']`
97
+
- if `$_ENV['root_path'].'.log/'`, use
98
+
- else use `$_ENV['root_path']`
99
+
- else
100
+
- if `dirname($_SERVER['SCRIPT_NAME'])`, use
101
+
- else use `dirname($_SERVER['SCRIPT_NAME'])`
102
+
103
+
Errors are automatically logged. You can separately log information using:
104
+
```php
105
+
Debug::log('BOB');
106
+
```
107
+
108
+
By default, this will be JSON pretty printed. You can turn that off with
109
+
```php
110
+
Debug::configure(['pretty'=>false]);
111
+
```
112
+
113
+
You can also determine what gets logged. The second parameter is used in a regex max against the configured mode
114
+
```php
115
+
Debug::configure(['mode'=>'error debug']);
116
+
117
+
Debug::log('BOB','error');#< will log
118
+
Debug::log('BOB1','error|debug');#< will log
119
+
Debug::log('BOB2','info'); #< will not log
120
+
```
121
+
122
+
123
+
124
+
8
125
## Files
9
126
The primary functions are file inclusion functions `inc`, `req`, `incOnce`, `reqOnce`. They allow inclusion tracking, context isolation, variable injection, variable extraction, and global injection.
10
127
@@ -24,4 +141,4 @@ Files::inc('bob.php')
24
141
# Using variable injection and variable extraction
0 commit comments