Skip to content

Commit

Permalink
remove verbose smarty logs, unless smarty_debug == true (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Coutadeur authored and davidcoutadeur committed Jul 31, 2024
1 parent 7a39be8 commit 57dc766
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions conf/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
#$smarty_cache_dir = "/var/cache/service-desk/cache";

# Smarty debug mode - will popup debug information on web interface
# and add many smarty debug messages in error logs
$smarty_debug = false;

# Allow to override current settings with local configuration
Expand Down
1 change: 1 addition & 0 deletions docs/general-parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ This is also possible to enable Smarty debug, for web interface issues:
$smarty_debug = true;
.. tip:: Debug messages will appear on web interface.
You will also have many more messages in error logs.

Smarty
------
Expand Down
10 changes: 10 additions & 0 deletions htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@
$smarty->setCacheDir($cache_dir);
$smarty->debugging = $smarty_debug;

if(isset($smarty_debug) && $smarty_debug == true )
{
$smarty->error_reporting = E_ALL;
}
else
{
# Do not report smarty stuff unless $smarty_debug == true
$smarty->error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING;
}

error_reporting(0);
if ($debug) {
error_reporting(E_ALL);
Expand Down

0 comments on commit 57dc766

Please sign in to comment.