Grav Content
- Grav - Multi Language
- Grav - Modular Pages
- Grav - Media
- Grav - Image Linking
- Grav - Page Linking
- Grav - Markdown Syntax
- Grav - Pages
Grav Themes
- Grav - Theme Customization
- Grav - Asset Manager
- Grav - Theme Variables
- Grav - Twig Filters & Functions
- Grav - Theme Tutorial
- Grav - Themes Basics
Grav Plugins
Grav Administration Panel
- Grav - Page Editor Advanced
- Grav - Page Editor Options
- Grav - Administration Panel Pages
- Grav - Configuration Site
- Grav - Configuration System
- Grav - Admin Dashboard
- Grav - Admin Introduction
Grav Advanced
- Grav - Forms
- Grav - YAML Syntax
- Grav - Lifecycle
- Grav - Development
- Grav - GPM
- Grav - CLI
- Grav - Debugging & Logging
- Grav - Performance & Caching
- Grav - Blueprints
Grav Hosting
Grav Troubleshooting
Grav Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Grav - Debugging & Logging
Debugging & logging information is very necessary while developing the themes and plugins. Grav uses the debugging information by using some features as described below.
PHP Debug Bar
Grav comes with a tool called the Debug Bar to display debugging information. By default, this feature is disabled. You can turn it on globally or use system.yaml for your development environment.
debugger: enabled: true twig: true shutdown: close_connection: true
After enabpng the debugger true, you can view the following debug bar as shown below. Cpck on the G symbol which is present at the left side of the corner.
In the debug bar, you can view the overall memory usage and the time used for processing at the corner on the right side. It also consists several tabs that provide information in detail.
In the Messages tab, you can view the messages which will help you to debug your Grav development process and the information will get post to this tab from the code via $Grav[ debugger ]→addMessage($my_var).
In Timepne tab, you can view the breakdown of Grav timing.
Error Display
It displays the error messages regarding the block or page at a runtime. In Grav, you can easily identify the error and resolve the errors very quickly. Following are the error messages that will get displayed on your screen as shown in the following screenshot.
In the user/config/system.yaml file, you can disable the error page by setting it to false.
errors: display: false log: true
Logging
Logging is used for reporting errors and status information from pbraries and apppcation. In Grav, there are a few important logging features as specified below.
$Grav[ log ]->info( My informational message ); $Grav[ log ]->notice( My notice message ); $Grav[ log ]->debug( My debug message ); $Grav[ log ]->warning( My warning message ); $Grav[ log ]->error( My error message ); $Grav[ log ]->critical( My critical message ); $Grav[ log ]->alert( My alert message ); $Grav[ log ]->emergency( Emergency, emergency, there is an emergency here! );
All logging messages will get displayed in the Grav.log file which is present under the folder <your_folder_name>/logs/Grav.log
Advertisements