From b10baf4aa446ea101593d672f3111ab00305d076 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 20 Feb 2024 10:54:52 +0900 Subject: [PATCH 1/7] docs: fix heading marks and title --- user_guide_src/source/testing/debugging.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/user_guide_src/source/testing/debugging.rst b/user_guide_src/source/testing/debugging.rst index 6c589ead52aa..bcd3304ae0ac 100644 --- a/user_guide_src/source/testing/debugging.rst +++ b/user_guide_src/source/testing/debugging.rst @@ -1,14 +1,14 @@ -************************** +########################## Debugging Your Application -************************** +########################## .. contents:: :local: :depth: 2 -================ -Replace var_dump -================ +******************** +Replacing var_dump() +******************** While using XDebug and a good IDE can be indispensable to debug your application, sometimes a quick ``var_dump()`` is all you need. CodeIgniter makes that even better by bundling in the excellent `Kint `_ @@ -50,9 +50,9 @@ For more information, see `Kint's page `_. .. _the-debug-toolbar: -================= +***************** The Debug Toolbar -================= +***************** The Debug Toolbar provides at-a-glance information about the current page request, including benchmark results, queries you have run, request and response data, and more. This can all prove very useful during development From 9e1629e94be7062bb0876348ff6f4d77dc8ed76b Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 20 Feb 2024 10:55:56 +0900 Subject: [PATCH 2/7] docs: add empty line --- user_guide_src/source/testing/debugging.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/user_guide_src/source/testing/debugging.rst b/user_guide_src/source/testing/debugging.rst index bcd3304ae0ac..87adcfb63995 100644 --- a/user_guide_src/source/testing/debugging.rst +++ b/user_guide_src/source/testing/debugging.rst @@ -10,11 +10,14 @@ Debugging Your Application Replacing var_dump() ******************** -While using XDebug and a good IDE can be indispensable to debug your application, sometimes a quick ``var_dump()`` is -all you need. CodeIgniter makes that even better by bundling in the excellent `Kint `_ -debugging tool for PHP. This goes way beyond your usual tool, providing many alternate pieces of data, like formatting -timestamps into recognizable dates, showing you hexcodes as colors, display array data like a table for easy reading, -and much, much more. +While using XDebug and a good IDE can be indispensable to debug your application, +sometimes a quick ``var_dump()`` is all you need. CodeIgniter makes that even +better by bundling in the excellent `Kint `_ +debugging tool for PHP. + +This goes way beyond your usual tool, providing many alternate pieces of data, +like formatting timestamps into recognizable dates, showing you hexcodes as colors, +display array data like a table for easy reading, and much, much more. Enabling Kint ============= From d352ff7eb2afa5cb671f481547091e7079e383af Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 20 Feb 2024 10:56:23 +0900 Subject: [PATCH 3/7] docs: add `:lines: 2-` --- user_guide_src/source/testing/debugging.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide_src/source/testing/debugging.rst b/user_guide_src/source/testing/debugging.rst index 87adcfb63995..ffa92289afcb 100644 --- a/user_guide_src/source/testing/debugging.rst +++ b/user_guide_src/source/testing/debugging.rst @@ -36,6 +36,7 @@ The ``d()`` method dumps all of the data it knows about the contents passed as t allows the script to continue executing: .. literalinclude:: debugging/001.php + :lines: 2- dd() ---- @@ -48,6 +49,7 @@ trace() This provides a backtrace to the current execution point, with Kint's own unique spin: .. literalinclude:: debugging/002.php + :lines: 2- For more information, see `Kint's page `_. From 5261a7e8fe30924fe18b053ce00d7e1fa1a923ca Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 20 Feb 2024 10:56:40 +0900 Subject: [PATCH 4/7] docs: move "CodeIgniter Error Logs" from troubleshooting.rst --- .../source/installation/troubleshooting.rst | 7 +------ user_guide_src/source/testing/debugging.rst | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/user_guide_src/source/installation/troubleshooting.rst b/user_guide_src/source/installation/troubleshooting.rst index 8ed12924732b..ed6db186e47d 100644 --- a/user_guide_src/source/installation/troubleshooting.rst +++ b/user_guide_src/source/installation/troubleshooting.rst @@ -102,9 +102,4 @@ After that, reload the page. You will see the error and the back trace. CodeIgniter Error Logs ---------------------- -CodeIgniter logs error messages, according to the settings in **app/Config/Logger.php**. - -You can adjust the error threshold to see more or fewer messages. See :ref:`Logging ` for details. - -The default configuration has daily log files stored in **writable/logs**. -It would be a good idea to check them if things aren't working the way you expect! +See :ref:`codeigniter-error-logs`. diff --git a/user_guide_src/source/testing/debugging.rst b/user_guide_src/source/testing/debugging.rst index ffa92289afcb..b07cf7a421ee 100644 --- a/user_guide_src/source/testing/debugging.rst +++ b/user_guide_src/source/testing/debugging.rst @@ -6,6 +6,23 @@ Debugging Your Application :local: :depth: 2 +************* +Checking Logs +************* + +.. _codeigniter-error-logs: + +CodeIgniter Error Logs +====================== + +CodeIgniter logs error messages, according to the settings in **app/Config/Logger.php**. + +The default configuration has daily log files stored in **writable/logs**. +It would be a good idea to check them if things aren't working the way you expect! + +You can adjust the error threshold to see more or fewer messages. See +:ref:`Logging ` for details. + ******************** Replacing var_dump() ******************** From 40144c4adf7e8de21d613c7c0e37bafbd8416417 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 20 Feb 2024 10:58:20 +0900 Subject: [PATCH 5/7] docs: add empty line --- user_guide_src/source/database/events.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/database/events.rst b/user_guide_src/source/database/events.rst index 8cefcad22dbf..55a1ef24e505 100644 --- a/user_guide_src/source/database/events.rst +++ b/user_guide_src/source/database/events.rst @@ -18,10 +18,13 @@ The Events DBQuery ======= -This event is triggered whenever a new query has been run, whether successful or not. The only parameter is -a :doc:`Query ` instance of the current query. You could use this to display all queries -in STDOUT, or logging to a file, or even creating tools to do automatic query analysis to help you spot -potentially missing indexes, slow queries, etc. +This event is triggered whenever a new query has been run, whether successful or +not. The only parameter is a :doc:`Query ` instance of the +current query. + +You could use this to display all queries in STDOUT, or logging to a file, or +even creating tools to do automatic query analysis to help you spot potentially +missing indexes, slow queries, etc. An example usage might be: From 9f513aec75de7b3effc326b18fd51144bb8fc43d Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 20 Feb 2024 11:04:23 +0900 Subject: [PATCH 6/7] docs: add "Logging All SQL Queries" --- user_guide_src/source/database/events.rst | 4 +++- user_guide_src/source/testing/debugging.rst | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/database/events.rst b/user_guide_src/source/database/events.rst index 55a1ef24e505..53d1246cfd36 100644 --- a/user_guide_src/source/database/events.rst +++ b/user_guide_src/source/database/events.rst @@ -15,6 +15,8 @@ uses this to collect the queries to display in the Toolbar. The Events ********** +.. _database-events-dbquery: + DBQuery ======= @@ -26,6 +28,6 @@ You could use this to display all queries in STDOUT, or logging to a file, or even creating tools to do automatic query analysis to help you spot potentially missing indexes, slow queries, etc. -An example usage might be: +An example to log all queries: .. literalinclude:: events/001.php diff --git a/user_guide_src/source/testing/debugging.rst b/user_guide_src/source/testing/debugging.rst index b07cf7a421ee..c902ff5dcbfe 100644 --- a/user_guide_src/source/testing/debugging.rst +++ b/user_guide_src/source/testing/debugging.rst @@ -23,6 +23,12 @@ It would be a good idea to check them if things aren't working the way you expec You can adjust the error threshold to see more or fewer messages. See :ref:`Logging ` for details. +Logging All SQL Queries +======================= + +All SQL queries issued by CodeIgniter can be logged. +See :ref:`Database Events ` for details. + ******************** Replacing var_dump() ******************** From eb03676d3f978d366eb6025bea0e6315e9df478b Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 20 Feb 2024 11:11:02 +0900 Subject: [PATCH 7/7] docs: fix typo --- user_guide_src/source/testing/debugging.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/testing/debugging.rst b/user_guide_src/source/testing/debugging.rst index c902ff5dcbfe..1dd28205c8c2 100644 --- a/user_guide_src/source/testing/debugging.rst +++ b/user_guide_src/source/testing/debugging.rst @@ -33,7 +33,7 @@ See :ref:`Database Events ` for details. Replacing var_dump() ******************** -While using XDebug and a good IDE can be indispensable to debug your application, +While using Xdebug and a good IDE can be indispensable to debug your application, sometimes a quick ``var_dump()`` is all you need. CodeIgniter makes that even better by bundling in the excellent `Kint `_ debugging tool for PHP.