To add entries to the console, insert the following line of PHP anywhere in your code:
apply_filters('console', 'Enter something to debug here');
You can also add an optional log level like this:
apply_filters('console', 'Enter something to debug here', 'error');
The available log levels are: debug
, info
, notice
, warning
, error
, critical
, alert
, and emergency
.
To use the profiler, insert the following lines of PHP before and after the code you are profiling:
Before:
apply_filters('trace:start', 'Enter a description of what you are profiling here');
After:
apply_filters('trace:stop');
By default, Black Bar is only visible to administrator users. To enable it for all logged-in users, use this code snippet:
add_filter('blackbar/enabled', 'is_user_logged_in');
By default, Black Bar displays the 50 slowest action/filter hooks. To display all hooks, use this code snippet:
add_filter('blackbar/hooks/all', '__return_true');